#!/bin/python3 import sys numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" def minimumNumber(n, password): gerek = 4 sayi = 0;buyuk = 0;kucuk = 0;ozel = 0 for i in password: if sayi == 0 and i in numbers: #sayi iceriyo mu gerek -= 1 sayi = 1 continue elif buyuk == 0 and i in upper_case: gerek -= 1 buyuk = 1 continue elif kucuk == 0 and i in lower_case: gerek -= 1 kucuk = 1 continue elif ozel == 0 and i in special_characters: gerek -= 1 ozel = 1 continue if gerek > 6 - len(password): return gerek else: return 6 - len(password) if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)