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 numbers = 0; int lCase = 0; int uCase = 0; int sCase = 0; int len = password.length(); for (int i = 0; i < len; i++) { int ascii = (int)password.charAt(i); if (ascii >= 65 && ascii <= 90) { uCase++; } else if (ascii >= 97 && ascii <= 122) { lCase++; } else if (ascii >= 48 && ascii <= 57) { numbers++; } else { sCase++; } } int count = 0; if (lCase == 0) { count++; } if (uCase == 0) { count++; } if (numbers == 0) { count++; } if (sCase == 0) { count++; } if (len + count < 6) { count += 6 - len - count; } return count; } 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(); } }