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