#!/bin/python import sys def minimumNumber(s): numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" c = [False] * 4 for ch in s: if ch in numbers: c[0] = True if ch in lower_case: c[1] = True if ch in upper_case: c[2] = True if ch in special_characters: c[3] = True n = 4 for bo in c: if bo: n -= 1 if n > 6 - len(s): print (n) else: print(6 - len(s)) if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() minimumNumber(password)