#!/bin/python3 numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" import sys def minimumNumber(n, password): number = False lower = False upper = False special = False for char in password: if (not number) and (char in numbers): number = True #print(number) if (not lower) and (char in lower_case): lower = True #print(lower) if (not upper) and (char in upper_case): upper = True #print(upper) if (not special) and (char in special_characters): special = True #print(special) bools = [number, lower, upper, special] #print(bools) missing = abs(sum(bools) - 4) return missing + max((6 - len(password) - missing), 0) if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)