characters = ["0123456789", "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "!@#$%^&*()-+"] n = int(input()) satistied = [False, False, False, False] count = 4 s = input() for character in s: for i in range(4): if not satistied[i] and character in characters[i]: count -= 1 satistied[i] = True print(max(count, 6-n))