n=int(raw_input()) x= raw_input() count=0 if ('0' in x or '1' in x or '2'in x or '3' in x or '4' in x or '5' in x or '6' in x or '7' in x or '8' in x or '9' in x): count=count else: count+=1 check=0 for v in x: if ord(v)>=65 and ord(v)<=90: check=1 break if check==0: count+=1 check=0 for v in x: if ord(v)>=97 and ord(v)<=122: check=1 break if check==0: count+=1 #"!@#$%^&*()-+" if ('!' in x or '@' in x or '#' in x or '$' in x or '%' in x or '^' in x or '&' in x or '*' in x or '()' in x or ')' in x or '-' in x or '+' in x): count=count else: count+=1 if len(x)+count<6: count+=6-(len(x)+count) print count