#!/bin/python3 import sys def minimumNumber(n, password): # Return the minimum number of characters to make the password strong if(n==0): return 6 if(n==1): return 5 if(n==2): return 4 add=0 if(not any(x.isupper() for x in password)): add+=1 if(not any(x.islower() for x in password)): add+=1 if(not any(x.isdigit() for x in password)): add+=1 s = "!@#$%^&*()-+" flag=False for i in s: if(i in password): flag=True break if(flag==False): add+=1 total = add + n if(total>=6): return add else: return add+(6-total) if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)