#!/bin/python import sys def minimumNumber(n, password): numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" has_number = False has_lower_case = False has_upper_case = False has_special = False for c in password: if c in numbers: has_number = True if c in lower_case: has_lower_case = True if c in upper_case: has_upper_case = True if c in special_characters: has_special = True res = 0 if not has_number: res += 1 if not has_lower_case: res += 1 if not has_upper_case: res += 1 if not has_special: res += 1 if n + res < 6: res = 6 - n return res if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer