import java.util.*; class Solution { static int minimumNumber(int n, String s) { boolean flag[] = new boolean[4]; for(int i=0;i=(int)'a' && c<=(int)'z') flag[0]=t=true; if(c>=(int)'A' && c<=(int)'Z') flag[1]=t=true; if(c>=(int)'0' && c<=(int)'9') flag[2]=t=true; if(!t) flag[3]=true; } int k=0; for(int i=0;i<4;i++) if(!flag[i]) k++; return (6-n)>k?(6-n):k; } 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(); } }