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) { // Return the minimum number of characters to make the password strong int lc=1,uc=1,sc=1,dig=1,len=6; for(int i=0;i0) len--; if(dig>0 && Character.isDigit(c)) dig--; if(lc>0 && Character.isLowerCase(c)) lc--; if(uc>0 && Character.isUpperCase(c)) uc--; if(sc>0 && (c=='!' || c=='@' || c=='#' || c=='$' || c=='%' ||c=='^' || c=='&' || c=='*' || c=='(' || c==')' || c=='-' || c=='+')) sc--; } int count = dig+sc+lc+uc; //System.out.println("len:"+len+" count:"+count); return Math.max(len,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(); } }