import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int T = in.nextInt(); //test cases String str = in.next(); char[] numbers = "0123456789".toCharArray(); char[] lower_case = "abcdefghijklmnopqrstuvwxyz".toCharArray(); char[] upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray(); char[] special_characters = "!@#$%^&*()-+".toCharArray(); in.close(); int count = 0; boolean[] trues = new boolean[4]; for (int j = 0; j < numbers.length; j++) { if (str.indexOf(numbers[j]) >= 0) { trues[0] = true; break; } } for (int j = 0; j < lower_case.length; j++) { if (str.indexOf(lower_case[j]) >= 0) { trues[1] = true; break; } } for (int j = 0; j < upper_case.length; j++) { if (str.indexOf(upper_case[j]) >= 0) { trues[2] = true; break; } } for (int j = 0; j < special_characters.length; j++) { if (str.indexOf(special_characters[j]) >= 0) { trues[3] = true; break; } } for (int i = 0; i < 4; i++) { if (!trues[i]) count++; } if (T + count < 6) { System.out.println(6 - T); }else System.out.println(count); } // public int function(int[] arr) { // // } }