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) { int d=6-password.length(); int l=0,u=0,s=0,dg=0; for(int i=0;i=97&&ch<=122) l=1; else if(ch>=65&&ch<=90) u=1; else if(ch>=48&&ch<=57) dg=1; else s=1; } int req=u+l+dg+s; req=4-req; //System.out.println(d); return Math.max(d,req); // Return the minimum number of characters to make the password strong } 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(); } }