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) { String sl="!@#$%^&*()-+"; boolean sm=false,lr=false,num=false,spl=false; int c=0; for(int i=0;i='a' && a<='z' && !sm) sm=true; else if(a>='A' && a<='Z' && !lr) lr=true; else if(a>='0' && a<='9' && !num) num=true; else if(sl.indexOf(a)>=0 && !spl) spl=true; } //System.out.print(sm+" "+lr+" "+num+" "+spl); if(!sm) c++; if(!lr) c++; if(!num) c++; if(!spl) c++; n+=c; if(n<6) c+=6-n; return c; // Return the minimum number of characters to make the password strong } 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(); } }