import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { private static Set spcl; static int minimumNumber(int n, String password) { boolean len = false, dig = false, lc = false, uc = false, sc = false; int toAdd = 0; // Return the minimum number of characters to make the password strong for (int i = 0; i < n; i++) { char ch = password.charAt(i); if (Character.isDigit(ch)) { dig = true; } else if (Character.isLowerCase(ch)) { lc = true; } else if (Character.isUpperCase(ch)) { uc = true; } else if (spcl.contains(ch)) { sc = true; } } if (!dig) { toAdd += 1; } if (!lc) { toAdd += 1; } if (!uc) { toAdd += 1; } if (!sc) { toAdd += 1; } int newLen = n + toAdd; if (newLen < 6) { toAdd += 6 - newLen; } return toAdd; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); String password = in.next(); spcl = new HashSet(Arrays.asList('!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '-', '+')); int answer = minimumNumber(n, password); System.out.println(answer); in.close(); } }