import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static final String numbers = "0123456789"; static final String lower_case = "abcdefghijklmnopqrstuvwxyz"; static final String upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; static final String special_characters = "!@#$%^&*()-+"; public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); String line = in.next(); boolean hasNumber; boolean haslower; boolean hasUpper; boolean hasSpecial; hasNumber = line.chars().filter(i -> numbers.contains(String.valueOf((char) i))).count() > 0; haslower = line.chars().filter(i -> lower_case.contains(String.valueOf((char) i))).count() > 0; hasUpper = line.chars().filter(i -> upper_case.contains(String.valueOf((char) i))).count() > 0; hasSpecial = line.chars().filter(i -> special_characters.contains(String.valueOf((char) i))).count() > 0; System.out.println( Math.max(6- line.length(), (hasNumber ? 0 : 1) + (haslower ? 0 : 1) + (hasUpper ? 0 : 1) + (hasSpecial ? 0 : 1) ) ); in.close(); } }