#!/bin/python3 import sys def minimumNumber(n, s): # Return the minimum number of characters to make the password strong n = "0123456789" lc ="abcdefghijklmnopqrstuvwxyz" uc= "ABCDEFGHIJKLMNOPQRSTUVWXYZ" sc ="!@#$%^&*()-+" (c,c1,c2,c3)=(0,0,0,0) co=0 for i in s: if i in n and c<1: c=1 co +=1 elif i in lc and c1<1: c1=1 co +=1 elif i in uc and c2<1: c2=1 co +=1 elif i in sc and c3<1: c3=1 co +=1 l=6-len(s) lm=4-co if len(s)<6 and l>lm: return l else: co =4-co return co if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)