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 = "!@#$%^&*()-+"; //if(n < 6) // return (6 - n); int no, lc, uc, sc; no = lc = uc = sc =0; int c = 0; for(int x = 0; x < numbers.length(); x++) //Numbers { if(password.contains(numbers.charAt(x) + "")) no++; } for(int x = 0; x < lower_case.length(); x++) //Numbers { if(password.contains(lower_case.charAt(x) + "")) lc++; } for(int x = 0; x < upper_case.length(); x++) //Numbers { if(password.contains(upper_case.charAt(x) + "")) uc++; } for(int x = 0; x < special_characters.length(); x++) //Numbers { if(password.contains(special_characters.charAt(x) + "")) sc++; } if(no == 0) c++; if(uc == 0) c++; if(lc == 0) c++; if(sc == 0) c++; if(n < 6 && c + n < 6) return 6 - n; else return c; } 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(); } }