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) { // Return the minimum number of characters to make the password strong int totalChar = password.length(); int upperCase = 0,count=0; int lowerCase = 0; int digits = 0; int others = 0; for (int i = 0; i < password.length(); i++) { char ch = password.charAt(i); if (Character.isUpperCase(ch)) { upperCase++; } else if (Character.isLowerCase(ch)) { lowerCase++; } else if (Character.isDigit(ch)) { digits++; } else { others++; } } if(upperCase==0) count++; if(lowerCase==0) count++; if(digits==0) count++; if(others==0) count++; if(count+n<6) { count+=(6-count-n); } 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(); } }