import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner ob = new Scanner(System.in); int l = ob.nextInt(); ob.nextLine(); String s=ob.nextLine(); int i,j,k,count=0; long sum=0L; // !@#$%^&*()-+ int t=0,r=0,v=0,st=0; for(i = 0; i < l; i++) { char c=s.charAt(i); int p= (int)c; if(p>=47 && p<=57 ) { r=1; } if(p>=65 && p<=90) { v=1; } if(p>=97 && p<=122) { st=1; } if(c=='!'||c=='@'||c=='#'||c=='$'||c=='%'||c=='^'||c=='&'||c=='*'||c=='('||c==')'||c=='-'||c=='+' ) { t=1; } } if(r!=1) count++; if(v!=1) count++; if(st!=1) count++; if(t!=1) count++; // System.out.println(count); if(l+count<6) { count=count+6-(l+count) ; } System.out.println(count); } }