import java.io.*; import java.util.*; /** * * @author akashvermaofskt * Coding is love <3! */ class Stron { 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 pwd=next(); HashMap map=new HashMap<>(); for (int i = 0; i < pwd.length(); i++) { map.put(pwd.charAt(i), 1); } String numbers = "0123456789"; String lower_case = "abcdefghijklmnopqrstuvwxyz"; String upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; String sc = "!@#$%^&*()-+"; int ans=0; int flag=0; for (int i = 0; i < numbers.length(); i++) { if(map.containsKey(numbers.charAt(i)))flag=1; } if(flag==0)ans++; flag=0; for (int i = 0; i < lower_case.length(); i++) { if(map.containsKey(lower_case.charAt(i)))flag=1; } if(flag==0)ans++; flag=0; for (int i = 0; i < upper_case.length(); i++) { if(map.containsKey(upper_case.charAt(i)))flag=1; } if(flag==0)ans++; flag=0; for (int i = 0; i < sc.length(); i++) { if(map.containsKey(sc.charAt(i)))flag=1; } if(flag==0)ans++; if(pwd.length()+ans<6){ ans+=6-(pwd.length()+ans); } bw.write(ans+"\n"); bw.flush(); } catch (Exception e) { e.printStackTrace(); } } }