import java.util.*; import java.io.*; class StrongPassword { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); static StringTokenizer st = null; static String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } static int nextInt() { return Integer.parseInt(next()); } static long nextLong() { return Long.parseLong(next()); } public static void main(String args[]) { try { int n=nextInt(); String s=next(); String sp="!@#$%^&*()-+"; int a=0,b=0,c=0,d=0; for(int i=0;i='0' && ch<='9') a=1; if(ch>='a' && ch<='z') b=1; if(ch>='A' && ch<='Z') c=1; if(sp.indexOf(ch)!=-1) d=1; } int count=0; if(a==0) count++; if(b==0) count++; if(c==0) count++; if(d==0) count++; int p=n+count; if(p<6) System.out.println(6-p+count); else System.out.println(count); bw.flush(); } catch (Exception e) { e.printStackTrace(); } } }