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) { String numbers = "0123456789"; String lower_case = "abcdefghijklmnopqrstuvwxyz"; String upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; String special_characters = "!@#$%^&*()-+"; boolean hasDigit = false; boolean hasSpecial = false; boolean hasUpper = false; boolean hasLower = false; for(char ch : password.toCharArray()) { if(Character.isUpperCase(ch)) hasUpper = true; if(Character.isLowerCase(ch)) hasLower = true; if(Character.isDigit(ch)) hasDigit = true; for(int i = 0; i < special_characters.length(); i++) { if(ch == special_characters.charAt(i)) { hasSpecial = true; } } } int count = 0; if(!hasDigit) count++; if(!hasUpper) count++; if(!hasLower) count++; if(!hasSpecial) count++; if(count + n < 6) count += 6 - (n + count); return count; } 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(); } }