#!/bin/python import sys def minimumNumber(n, password): # Return the minimum number of characters to make the password strong numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" l=[0 for x in range(4)] c=0 for j in password: if j in numbers: l[0]+=1 if j in lower_case: l[1]+=1 if j in upper_case: l[2]+=1 if j in special_characters: l[3]+=1 for x in l: if(x==0): c+=1 if(n+c<6): c=c+(6-n-c) return c if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer