import sys def minimumNumber(n, password): numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" least = 6 enough = False total = 0 sub_total = 0 if n < least: enough = True total = (least - n) if not (any(password[i] in numbers for i in range(len(password)))): if enough: sub_total += 1 else: total += 1 if not (any(password[i] in lower_case for i in range(len(password)))): if enough: sub_total += 1 else: total += 1 if not (any(password[i] in upper_case for i in range(len(password)))): if enough: sub_total += 1 else: total += 1 if not (any(password[i] in special_characters for i in range(len(password)))): if enough: sub_total += 1 else: total += 1 if enough and sub_total > total: return sub_total else: return total if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)