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) { char ch; int i=0,lc=0,uc=0,dg=0,sum=0; for(int j=1;j=65 && c<=90) uc++; else if(c>=97 &&)c<=122) lc++; else if(c>=0 && c<=9) dg++; else if(ch=='!') i++; else if(ch=='@') i++; else if(ch=='#') i++; else if(ch=='$') i++; else if(ch=='%') i++; else if(ch=='^') i++; else if(ch=='&') i++; else if(ch=='*') i++; else if(ch=='(') i++; else if(ch==')') i++; else if(ch=='-') i++; else if(ch=='+') i++; sum=i+lc+uc+dg; if(lc>=1 && uc>=1 && dg>=1 && i>=1 && sum>=6) {} else if(sum<6) System.out.println(6-sum) } } 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(); } }