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) { boolean num=false; boolean lc=false; boolean uc=false; boolean sc=false; int c=0; for(int i=0;i='a' && ch<='z') lc=true; else if(ch>='A' && ch<='Z') uc=true; else if(ch>='0' && ch<='9') num=true; else sc=true; } if(lc==false) c++; if(uc==false) c++; if(num==false) c++; if(sc==false) c++; if(n+c>6) return c; else { int x=6-(n+c); return c+x; } } 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(); } }