import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class StrongPassword { public static void main(String[] args) throws IOException{ BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); int len=Integer.parseInt(in.readLine()); char[] string=in.readLine().trim().toCharArray(); boolean digit=false; boolean low=false; boolean up=false; boolean special=false; for (int i = 0; i < string.length&&!(digit&&low&&up&&special); i++) { if(string[i]>=48&&string[i]<=57) { digit=true; }else if(string[i]>=97&&string[i]<=122) { low=true; }else if(string[i]>=65&&string[i]<=90) { up=true; }else{ special=true; } } int cantidad=0; if(!digit) cantidad++; if(!low) cantidad++; if(!up) cantidad++; if(!special) cantidad++; if(len>=6||len+cantidad>=6) { System.out.println(cantidad); }else System.out.println(6-len); } }