#!/bin/python3 import sys numbers = set("0123456789") lower_case = set("abcdefghijklmnopqrstuvwxyz") upper_case = set("ABCDEFGHIJKLMNOPQRSTUVWXYZ") special_characters = set("!@#$%^&*()-+") def minimumNumber(n, password): password_set = set(password) has_digit = any(x in numbers for x in password_set) has_lower = any(x in lower_case for x in password_set) has_upper = any(x in upper_case for x in password_set) has_special = any(x in special_characters for x in password_set) res = max(6-n, 4-int(has_digit)-int(has_lower)-int(has_upper)-int(has_special)) return res if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)