#!/bin/python3 import sys def minimumNumber(n, password): # Return the minimum number of characters to make the password strong d, lc, uc, sp = False, False, False, False count = 0 for x in password: if x.isupper(): uc = True elif x.islower(): lc = True elif x.isnumeric(): d = True elif (x=='!') or (x=='@') or (x=='#') or (x=='$') or (x=='%') or (x=='&') or (x=='*') or (x=='(') or x==')' or (x=='-') or (x=='+'): sp = True if d is False: count+=1 if lc is False: count+=1 if uc is False: count+=1 if sp is False: count+=1 if n + count < 6: return 6-n return count if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)