#!/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 = "!@#$%^&*()-+" c1=0 c2=0 c3=0 c4=0 for i in password: if i in numbers: c1+=1 if i in lower_case: c2+=1 if i in upper_case: c3+=1 if i in special_characters: c4+=1 count=0 if c1==0: count+=1 if c2==0: count+=1 if c3==0: count+=1 if c4==0: count+=1 if n<6: if 6-n>count: count+=6-n-count return count if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer