import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; class p1 { public static void main(String args[])throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringBuilder output=new StringBuilder(); int N=Integer.parseInt(br.readLine()); String pass=br.readLine(); boolean len=false,digit=false,lower=false,upper=false,special=false; if(N>=6) len=true; for (int i = 0; i ='0' && c<='9') digit=true; else if(c>='a' && c<='z') lower=true; else if(c>='A' && c<='Z') upper=true; else if(c=='!'|| c=='@' || c=='#' ||c=='$' ||c=='%' ||c=='^' || c=='&' || c=='*' || c=='(' || c==')' || c=='-' || c=='+' ) special=true; } int count=0; if(!digit) count++; if(!lower) count++; if(!upper) count++; if(!special) count++; if(N+count<6) { //System.out.println("inside"); count+=6-(N+count); } System.out.println(count); } }