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) { int a,e,c,d,f,sum; a=0;c=0;d=0;f=0;e=0; sum=0; if(n<6) f = 6-n; for(int i=0;i=65&&b<=90) a++; if(b>=97&&b<=122) e++; if(b>=48&&b<=57) c++; if("!@#$%^&*()-+".indexOf(b)>=0) d++; } if(a==0) sum++; if(e==0) sum++; if(c==0) sum++; if(d==0) sum++; if(sum>f) return sum; else return f; } 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(); } }