#!/bin/python3 import sys numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" def minimumNumber(n, password): # Return the minimum number of characters to make the password strong upper = False lower = False digit = False special = False out = 0 for c in password: if(c in numbers): digit = True if(c in lower_case): lower = True if(c in upper_case): upper = True if(c in special_characters): special = True if(not digit): out += 1 if(not lower): out += 1 if(not upper): out += 1 if(not special): out += 1 if(n + out < 6): out = 6-n return out if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)