n = int(input()) s = input() numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" nc = False loc = False upc = False spc = False for e in s: if e in numbers: nc = True pass if e in lower_case: loc = True pass if e in upper_case: upc = True pass if e in special_characters: spc = True pass pass t = 0 if not nc: t+=1 pass if not loc: t+=1 pass if not upc: t+=1 pass if not spc: t+=1 pass if n+t<6: t+=6-n-t pass print(t)