#!/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 add=0 num=len(list(filter(lambda x:x in numbers,password))) lc=len(list(filter(lambda x:x in lower_case,password))) uc=len(list(filter(lambda x:x in upper_case,password))) sc=len(list(filter(lambda x:x in special_characters,password))) if num==0: add+=1 if lc==0: add+=1 if uc==0: add+=1 if sc==0: add+=1 if n+add<6: add=6-n return add if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)