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 lenNeed = (password.length()>6)?0:(6-password.length()); int count = 0; String numbers = "0123456789"; String lower_case = "abcdefghijklmnopqrstuvwxyz"; String upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; String special_characters = "!@#$%^&*()-+"; count += contains(password,numbers); count += contains(password,lower_case); count += contains(password,upper_case); count += contains(password,special_characters); return Math.max(4-count,lenNeed); } public static int contains(String src,String lib){ for(char c: lib.toCharArray()){ if(src.indexOf(c)!=-1) return 1; } return 0; } 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(); } }