numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" num = False low_case = False upp_case = False spec = False n = int(raw_input()) s = raw_input() res = 0 for char in s: if not num and char in numbers: num = True elif not spec and char in special_characters: spec = True elif not low_case and char in lower_case: low_case = True elif not upp_case and char in upper_case: upp_case = True #print num, low_case, upp_case, spec if not num: res += 1 if not low_case: res += 1 if not upp_case: res += 1 if not spec: res += 1 if n + res < 6: res += (6-(res+n)) print res