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 String numbers = "0123456789"; String lower_case = "abcdefghijklmnopqrstuvwxyz"; String upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; String special_characters = "!@#$%^&*()-+"; boolean[] checks = new boolean[4]; for(int i = 0; i < n; i++) { String character = password.substring(i, i+1); if(numbers.contains(character)) { checks[0] = true; } if(lower_case.contains(character)) { checks[1] = true; } if(upper_case.contains(character)) { checks[2] = true; } if(special_characters.contains(character)) { checks[3] = true; } } int neededChars = 0; for(int i = 0; i < 4; i++ ) { if(checks[i] == false) { neededChars++; } } if (n < 6 ) { if(neededChars > 6 - n) { return neededChars; } return 6 - n; } else { return neededChars; } } 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(); } }