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 f1=0,f2=0,f3=0,f4=0,count=0; for(int i=0;i='0' && ch<='9' && f1 == 0){ count++; f1=1; } else if(ch>='a' && ch<='z' && f2 == 0){ count++; f2=1; } else if(ch>='A' && ch<='Z' && f3 == 0){ count++; f3=1; } else if((ch =='!' || ch =='@' || ch=='#' || ch=='$' || ch=='%' || ch=='^' || ch=='&' || ch=='*' || ch=='(' || ch==')' || ch=='-' || ch=='+')&&(f4==0)){ count++; f4=1; } } if(count==4 && n>6){ return 0; } else if((4-count)>(6-n)){ return (4-count); } 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(); } }