#!/bin/python3 import sys def minimumNumber(n, password): numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" password1 = password num_ok = False low_ok = False up_ok = False sp_ok = False n1 = 0 for i in range(0,n): if password1[i] in numbers: num_ok = True elif password1[i] in lower_case: low_ok = True elif password1[i] in upper_case: up_ok = True elif password1[i] in special_characters: sp_ok = True if num_ok and low_ok and up_ok and sp_ok and (len(password1) >= 6): return 0 if num_ok == False: n1 = n1 +1 if low_ok == False: n1 = n1+1 if up_ok == False: n1 = n1+1 if sp_ok == False: n1 = n1+1 if (n1+n)< 6: n1 += (6-(n1+n)) return n1 # Return the minimum number of characters to make the password strong if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)