#!/bin/python3 import sys def minimumNumber(n, password): numbers = set("0123456789") lower_case = set("abcdefghijklmnopqrstuvwxyz") upper_case = set("ABCDEFGHIJKLMNOPQRSTUVWXYZ") special_characters = set("!@#$%^&*()-+") l=False; L=False;U=False; S=False; N=False; if n >= 6: l=True if len(lower_case & set(password)) >=1: L=True if len(upper_case & set(password)) >=1: U=True if len(special_characters & set(password)) >=1: S=True if len(numbers & set(password)) >=1: N=True count=0 count1=0 pwd=set(password) if l is True: if L is False: count+=1 if U is False: count+=1 if S is False: count+=1 if N is False: count+=1 return count else: count=6-n if L is False: count1+=1 if U is False: count1+=1 if S is False: count1+=1 if N is False: count1+=1 r=count1-count if r >0: count+=r return count if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)