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 p) { // Return the minimum number of characters to make the password strong int count=0; String numbers = "0123456789"; boolean nf=false; String lower_case = "abcdefghijklmnopqrstuvwxyz"; boolean lf=false; String upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; boolean uf=false; String special_characters = "!@#$%^&*()-+"; boolean sf=false; for(int i=0;i=0){ nf=true; } if(lower_case.indexOf(p.charAt(i))>=0){ lf=true; } if(upper_case.indexOf(p.charAt(i))>=0){ uf=true; } if(special_characters.indexOf(p.charAt(i))>=0){ sf=true; } } int c=0; if(nf==false){ c++; } if(lf==false){ c++; } if(uf==false){ c++; } if(sf==false){ c++; } if(n+c<6){ c+= (6-(n+c)); } 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(); } }