#!/bin/python3 import sys def minimumNumber(n, password): # Return the minimum number of characters to make the password strong if n==0: return 6 uppers, lowers, digits, characs = 0, 0, 0, 0 for l in password: if l.isupper(): uppers += 1 elif l.islower(): lowers += 1 elif l.isdigit(): digits += 1 elif not l.isalnum(): characs += 1 #caculate what is needed content_req=max(0,1-uppers)+max(0,1-lowers)+max(0,1-digits)+max(0,1-characs) length_req=max(0,6-n) #print(content_req, length_req) return max(content_req,length_req) if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)