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) { int count=4; if(password.matches(".*\\d+.*")) count--; if(password.matches(".*[a-z]+.*")) count--; if(password.matches(".*[A-Z]+.*")) count--; if(password.matches(".*[$&+,:;=?@#|'<>.^*()%!-]+.*")) count--; if(password.length()+count<6) return 6-password.length(); else return count; // Return the minimum number of characters to make the password strong } 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(); } }