import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int minimumNumber(int n, String password) { int result =0; int length_short =0; if(n<6) { length_short =6-n; } int[] arr =new int[4]; for(int i=0;i47&&num<58) { arr[0]=1; } else if(num>96 && num<123) { arr[1]=1; } else if(num>64 && num<91) { arr[2]=1; } else { if(password.charAt(i)=='!'||password.charAt(i)=='@'||password.charAt(i)=='%'||password.charAt(i)=='#'||password.charAt(i)=='^'||password.charAt(i)=='&'||password.charAt(i)=='('||password.charAt(i)==')'||password.charAt(i)=='-'||password.charAt(i)=='+') { arr[3]=1; } } } int total =arr[0]+arr[1]+arr[2]+arr[3]; total =4-total; if(length_short>total) { return length_short; } else { return total; } } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); String password = in.next(); int answer = minimumNumber(n, password); System.out.println(answer); in.close(); } }