#!/bin/python3 import sys def minimumNumber(n, password): # Return the minimum number of characters to make the password strong flag_digit = False flag_lower = False flag_upper = False flag_special = False for c in password: if c in "0123456789": flag_digit = True elif c in "abcdefghijklmnopqrstuvwxyz": flag_lower = True elif c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ": flag_upper = True elif c in "!@#$%^&*()-+": flag_special = True reqs = [flag_digit, flag_lower, flag_upper, flag_special].count(False) return max(max(6-n, 0), reqs) if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)