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 int fl=0,fu=0,fd=0,fs=0; char[] a = new char[]{'!','@','#','$','%','^','&','*','(',')','-','+'}; for(int i=0;i='a') fl=1; else if(password.charAt(i)<='Z'&&password.charAt(i)>='A') fu=1; else if(password.charAt(i)<='9'&&password.charAt(i)>='0') fd=1; else { for(int k=0;k<12;k++) if(password.charAt(i)==a[k]) fs=1; } } int t=0; if(fl!=1) t++; if(fu!=1) t++; if(fd!=1) t++; if(fs!=1) t++; if(t+n<6) return 6-n; else return t; } 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(); } }