#!/bin/python3 import sys numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" def minimumNumber(n, password): digit, lower, upper, spec = [False] * 4 for c in password: if c in numbers: digit = True elif c in lower_case: lower = True elif c in upper_case: upper = True elif c in special_characters: spec = True flag = (0 if digit else 1) + (0 if lower else 1) + (0 if upper else 1) + (0 if spec else 1) res = 6 - n return res if res - flag >= 0 else flag if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)