uses math; var n,i,cnt:longint; password:string[100]; constraint:array[1..4]of boolean; begin readln(n); read(password); fillchar(constraint,sizeof(constraint),false); for i:=1 to n do if password[i] in ['0'..'9'] then constraint[1]:=true else if password[i] in ['a'..'z'] then constraint[2]:=true else if password[i] in ['A'..'Z'] then constraint[3]:=true else constraint[4]:=true; cnt:=0; for i:=1 to 4 do inc(cnt,ord(not constraint[i])); write(max(cnt,6-n)) end.