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