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 isNumber = false; boolean isLower = false; boolean isUpper = false; boolean isSpecial = false; for (int i = 0; i < password.length(); i++) { for (int j = 0; j < numbers.length(); j++) { if (password.charAt(i) == numbers.charAt(j)) { isNumber = true; } } for (int j = 0; j < lower_case.length(); j++) { if (password.charAt(i) == lower_case.charAt(j)) { isLower = true; } } for (int j = 0; j < upper_case.length(); j++) { if (password.charAt(i) == upper_case.charAt(j)) { isUpper = true; } } for (int j = 0; j < special_characters.length(); j++) { if (password.charAt(i) == special_characters.charAt(j)) { isNumber = true; } } } int num = 0; if (isNumber == false) { num++; } if (isLower == false) { num++; } if (isUpper == false) { num++; } if (isSpecial == false) { num++; } return 6 - n + num } 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(); } }