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 dig=0,sc=0,uc=0,sp=0,x=0; for(int i=0;i47 && (int)ch<58 && dig==0) dig++; if((int)ch>64 && (int)ch<91 && uc==0) uc++; if((int)ch>96 && (int)ch<123 && sc==0) sc++; if(((int)ch>32 && (int)ch<46 || (int)ch==64 || (int)ch==94) && sp==0 && (int)ch!=34 && (int)ch!=39 && (int)ch!=44) sp++; } if(dig==0) x++; if(uc==0) x++; if(sc==0) x++; if(sp==0) x++; if(x+n>=6) return x; else return 6-n; } 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(); } }