import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Password { static int minimumNumber(int n, String password) { HashSet numbers = new HashSet<>(); for(char c : "0123456789".toCharArray()) numbers.add(c); HashSet lowerCase = new HashSet<>(); for(char c : "abcdefghijklmnopqrstuvwxyz".toCharArray()) lowerCase.add(c); HashSet upperCase = new HashSet<>(); for(char c : "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray()) upperCase.add(c); HashSet spl = new HashSet<>(); for(char c : "!@#$%^&*()-+".toCharArray()) spl.add(c); int len = password.length(); boolean hasDigit=false,hasLowerCase=false,hasUpperCase=false,hasSpecial=false; for(int i=0;i=6) break; } int count=0; if(!hasDigit) count++; if(!hasLowerCase) count++; if(!hasUpperCase) count++; if(!hasSpecial) count++; if(len+count<6) count += 6-(len+count); return count; } 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(); } }