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) { char[] p = password.toCharArray(); boolean num,upper,lower,special; num = false; upper = false; lower = false; special = false; String s = "!@#$%^&*()-+"; for(int i = 0; i < p.length; i++) { if(!num && Character.isDigit(p[i])) num = true; else if(!upper && Character.isUpperCase(p[i])) upper = true; else if(!lower && Character.isLowerCase(p[i])) lower = true; else if(!special && s.contains(Character.toString(p[i]))) special = true; } int need = 0; if(!upper) need ++; if(!lower) need++; if(!special) need++; if(!num) need++; return Math.max(need,6-n); // 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(); } }