import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static HashSet special = null; static int minimumNumber(int n, String password) { // Return the minimum number of characters to make the password strong boolean capLetter = false; boolean smallLetter = false; boolean sp = false; boolean dig = false; for(int i=0; i='A' && c<= 'Z'){ capLetter = true; } else if(c>='a' && c<='z'){ smallLetter = true; } else if(c>='0' && c<='9'){ dig = true; } else if(isSpecialChar(c)){ sp = true; } } int count = 0; if(!capLetter) count++; if(!smallLetter) count++; if(!sp) count++; if(!dig) count++; return Math.max(count, 6-n); } public static boolean isSpecialChar(char c){ if(special == null){ char[] arr = {'!','@', '#', '$', '%', '^', '&', '*', '(', ')', '-', '+'}; special = new HashSet(); for(char ch: arr){ special.add(ch); } } return special.contains(c); } 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(); } }