import sys def minimumNumber(n, password): c=0 if(len(password)>=6): if(any(x.isdigit() for x in password)): if(any(x.islower() for x in password)): if(any(x.isupper() for x in password)): if(any(33<=ord(x)<=47 or ord(x)==94 for x in password)): print("0") else: c+=1 else: c+=1 else: c+=1 else: c+=1 else: if(any(x.isdigit() for x in password)): if(any(x.islower() for x in password)): if(any(x.isupper() for x in password)): if(any(33<=ord(x)<=47 or ord(x)==94 for x in password)): c=0 else: c+=1 else: c+=1 else: c+=1 else: c+=1 if(n+c<6): c=c+6-n+c return c n = int(input().strip()) password = input().strip() print("k") answer = minimumNumber(n, password) print("k")