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) { int count = 0; String numbers = "0123456789"; String lower_case = "abcdefghijklmnopqrstuvwxyz"; String upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; String special_characters = "!@#$%^&*()-+"; if(!check(numbers, password)) count ++; if(!check(lower_case, password)) count ++; if(!check(upper_case, password)) count ++; if(!check(special_characters, password)) count ++; if(n + count < 6) count += (6 - n - count); return count; } static boolean check(String s, String password) { for(char c : s.toCharArray()) { if(password.indexOf(c) >= 0) { return true; } } return false; } 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(); } }