import java.util.Scanner; public class Solution { private static final String special_characters = "!@#$%^&*()-+"; private static final int MIN_LENGTH = 6; static int minimumNumber(int n, String password) { // Return the minimum number of characters to make the password strong int symbolsToAdd = 0; boolean hasNumber =false; boolean hasLowerCase = false; boolean hasUpperCase = false; boolean hasSpecial = false; for (int i = 0; i < password.length(); i++) { if (Character.isDigit(password.charAt(i))) { if (!hasNumber) { hasNumber = true; } continue; } if (Character.isLetter(password.charAt(i))) { if (!hasLowerCase && Character.isLowerCase(password.charAt(i))) { hasLowerCase = true; } if (!hasUpperCase && Character.isUpperCase(password.charAt(i))) { hasUpperCase = true; } continue; } if (special_characters.indexOf(password.charAt(i)) != -1) { hasSpecial = true; } } if (!hasNumber) { symbolsToAdd++; } if (!hasLowerCase) { symbolsToAdd++; } if (!hasUpperCase) { symbolsToAdd++; } if (!hasSpecial) { symbolsToAdd++; } if (password.length() + symbolsToAdd < MIN_LENGTH) { symbolsToAdd = MIN_LENGTH - password.length(); } return symbolsToAdd; } 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(); } }