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) { String numbers = "0123456789"; String lower_case = "abcdefghijklmnopqrstuvwxyz"; String upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; String special_characters = "!@#$%^&*()-+"; int countN = 0, countL = 0, countU = 0, countS = 0, count = 0; for(int i = 0; i < password.length(); i++) { if(numbers.contains(password.substring(i,i+1))) countN++; else if(lower_case.contains(password.substring(i,i+1))) countL++; else if(upper_case.contains(password.substring(i,i+1))) countU++; else if(special_characters.contains(password.substring(i,i+1))) countS++; } if(countN==0) count++; if(countL==0) count++; if(countU==0) count++; if(countS==0) count++; return Math.max(count, 6-password.length()); } 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(); } }