#!/bin/python3 import sys def minimumNumber(n, password): numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" bool1=bool2=bool3=bool4=False count2=0 if(len(password)>=6): count=0 else: count=6-len(password) for x in password: if x in numbers: bool1=True if x in lower_case: bool2=True if x in upper_case: bool3=True if x in special_characters: bool4=True if bool1==False: count2+=1 if bool2==False: count2+=1 if bool3==False: count2+=1 if bool4==False: count2+=1 #print(bool1,bool2,bool3,bool4,count) return(max(count,count2)) if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)