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 num = 0; int lc = 0; int uc = 0; int sc = 0; int res = 0; for (int i = 0; i < n; i++) { char c = password.charAt(i); if (numbers.indexOf(c) != -1) { num++; } else if (lower_case.indexOf(c) != -1) { lc++; } else if (upper_case.indexOf(c) != -1) { uc++; } else if (special_characters.indexOf(c) != -1) { sc++; } } if (num == 0) { res++; } if (lc == 0) { res++; } if (uc == 0) { res++; } if (sc == 0) { res++; } if (n + res < 6) { res += 6 - (n + res); } return res; } 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(); } }