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 minLength = false, lowerCase = true, upperCase = true, specialChar = true, numbers = true; String specialChars = "!@#$%^&*()-+"; int answer = 0; if (n < 6) minLength = true; for (int i = 0; i < n; i++) { char c = password.charAt(i); if (c == '0' || c == '1' || c == '2' || c == '3' || c == '4' || c == '5' || c == '6' || c == '7' || c == '8' || c == '9') { numbers = false; } else { if ((int)c >= 65 && (int)c <= 90) { upperCase = false; } else if ((int) c >= 97 && (int)c <= 122) { lowerCase = false; } else { if (specialChar) { for (int j = 0; j < specialChars.length(); j++) { char sChars = specialChars.charAt(j); if (c == sChars) { specialChar = false; break; } } } } } } if (minLength) { answer = 6 - n; //System.out.println("Minimum length is 6 less "+answer); } int counter = 0; if (upperCase) { // System.out.println("UPPwer true"); counter++; } if (lowerCase) { // System.out.println("lower true"); counter++; } if(specialChar) { counter++; } if (numbers) { counter++; } if (answer < counter) { answer += (counter - answer); } return answer; } 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(); } }