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) { long cap = 0; long small = 0; long num = 0; long spe = 0; int finalRes = 0; for(int i=0;i=97 && password.charAt(i)<=122) small++; else if(password.charAt(i)>=48 && password.charAt(i)<=57) num++; else if (password.charAt(i)>=65 && password.charAt(i)<=90) cap++; else spe++; } int len = 0; if(password.length()>=6){ if(cap<1) finalRes++; if(small<1) finalRes++; if(num<1) finalRes++; if(spe<1) finalRes++; return finalRes; }else{ if(cap<1) len++; if(small<1) len++; if(num<1) len++; if(spe<1) len++; if(len+password.length()<6) len +=(6-len-password.length()); return len; } } 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(); } }