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 s) { // Return the minimum number of characters to make the password strong int l=6; int d=0,lc=0,uc=0,sc=0; for(int i=0;i='0' && c<='9') {d=1;} if(c>='a' && c<='z') {lc=1;} if(c>='A' && c<='Z') {uc=1;} if(c=='!' || c=='@' || c=='#' || c=='$' || c=='%' || c=='^' || c=='&' || c=='*' || c=='(' || c==')' || c=='-' || c=='+') {sc=1;} } int ans=0; if(d==0) ans+=1; if(lc==0) ans+=1; if(uc==0) ans+=1; if(sc==0) ans+=1; int temp=ans; if(n<6 && temp<(6-n)) { ans=6-temp-n; ans+=temp; return ans; } return ans; } 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(); } }