numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" has = [0, 0, 0, 0] n = int(input()) s = input() for l in s: if l in numbers: has[0] = 1 elif l in lower_case: has[1] = 1 elif l in upper_case: has[2] = 1 elif l in special_characters: has[3] = 1 to_add = 0 for x in has: if not x: to_add += 1 n += 1 if n < 6: print(6-n+to_add) else: print(to_add)