#!/bin/python3 import sys def minimumNumber(n, password): # Return the minimum number of characters to make the password strong needed = 0 upper, lower, digit, special = False, False, False, False spec = ['!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '-', '+'] for c in password: if c.isupper(): upper = True elif c.islower(): lower = True elif c.isdigit(): digit = True elif c in spec: special = True if upper == False: needed += 1 if lower == False: needed += 1 if digit == False: needed += 1 if special == False: needed += 1 if 6 - len(password) > needed: return 6 - len(password) return needed if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)