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) { boolean hasDigit = false; boolean hasLower = false; boolean hasUpper = false; boolean hasSpecial = false; Set special = new HashSet<>(); String spe = "!@#$%^&*()-+"; for(int i =0; i='0'&&c<='9'){ hasDigit=true; } if(c>='a'&&c<='z'){ hasLower = true; } if(c>='A'&&c<='Z'){ hasUpper=true; } if(special.contains(c)){ hasSpecial= true;; } } if(!hasDigit){ n++; } if(!hasLower){ n++; }if(!hasUpper){ n++; }if(!hasSpecial){ n++; } if(n<6){ n=6; } return n-password.length(); } 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(); } }