numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" n = int(input()) s = input() bn,bl,bu,bs = False,False,False,False for c in s: if c in numbers: bn = True if c in lower_case: bl = True if c in upper_case: bu = True if c in special_characters: bs = True res = 0 if not bn: res += 1 if not bl: res += 1 if not bu: res += 1 if not bs: res += 1 if len(s) < 6: res = max(res, 6-len(s)) print(res)