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) { // Return the minimum number of characters to make the password strong boolean number = false; boolean lower = false; boolean upper = false; boolean spchar = false; int res = 0; for(int i = 0; i < n ; i++){ char c = password.charAt(i); if(c>=48 && c <= 57){ number = true; }else if(c >= 97 && c<= 122){ lower = true; }else if(c>=65 && c<=90){ upper = true; }else if(c=='!' || c=='@' || c== '#' || c=='$' || c=='%' || c=='^' || c=='&' || c=='*' || c=='(' || c==')'|| c=='-' ||c=='+'){ spchar = true; } } if(!number){ res++; } if(!lower){ res++; } if(!upper){ res++; } if(!spchar){ res++; } int rem = 6-(n+res); if(rem>0){ res+=rem; } return res; } 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(); } }