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) { char[] ch=password.toCharArray(); int count1=0; int count2=0; int count3=0; int count4=0; for(int i=0;i64 && (int)ch[i]<91) count1++; if((int)ch[i]>96 && (int)ch[i]<122) count2++; if(ch[i]=='!' || ch[i]=='@'|| ch[i]=='#' ||ch[i]=='$' ||ch[i]=='%'||ch[i]=='^'||ch[i]=='&'||ch[i]=='*'||ch[i]=='('||ch[i]==')'||ch[i]=='-'||ch[i]=='+') count3++; } if(count1>0 &&count2>0 && count3>0) return 0 else if(count1=0 && count2>0 &&count3>0) return 1; else if(count1=0 && count2=0 &&count3>0) return 2; else (count1=0 && count2=0 &&count3=0) return 3; } 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(); } }