#!/bin/python3 import sys specialcharacters = "!@#$%^&*()-+" def has_rng_chr(password, lb, ub): for char in password: if ord(char) in range(lb, ub): return True return False def has_number(password): return has_rng_chr(password, 48, 58) def has_uc(password): return has_rng_chr(password, 65, 91) def has_lc(password): return has_rng_chr(password, 97, 123) def has_special(password): for char in password: if char in "!@#$%^&*()-+": return True return False def minimumNumber(n, password): missing_types = 4 - (has_number(password) + has_uc(password) + has_lc(password) + has_special(password)) return max(6-n, missing_types) if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)