#!/bin/python3 import sys numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" def minimumNumber(n, password): numbers_exist = not any(map(lambda c: c in numbers, password)) lower_case_exist = not any(map(lambda c: c in lower_case, password)) upper_case_exist = not any(map(lambda c: c in upper_case, password)) special_characters_exist = not any(map(lambda c: c in special_characters, password)) res = sum(map(int, [numbers_exist, lower_case_exist, upper_case_exist, special_characters_exist])) res += max(0, 6 - (res + n)) return res if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)