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) { // Return the minimum number of characters to make the password strong char[] ch=password.toCharArray(); int a=0; int b=0; int c=0; int d=0; for (int i=0;i=65 && ch[i]<=90){ a=1; } if (ch[i]>=97 && ch[i]<=122){ b=1; } if (ch[i]>=48 && ch[i]<=57){ c=1; } if ((ch[i]>=35 && ch[i]<=38)||(ch[i]>=40 && ch[i]<=43)||(ch[i]=='@')||(ch[i]=='!')||(ch[i]=='^')||(ch[i]=='-')){ d=1; } } int res=0; if (a==0) res++; if (b==0) res++; if (c==0) res++; if (d==0) res++; if (n>=6) return res; else { return ((6-n)>res?(6-n):res); } } 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(); } }