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 isDigit = 1; int isLowercase = 1; int isUppercase = 1; int isSpecialChar = 1; char arr[] = password.toCharArray(); String specials = "!@#$%^&*()-+"; for(char ch : arr) { if(Character.isDigit(ch) && isDigit == 1) { isDigit = 0; } else if(Character.isUpperCase(ch) && isUppercase == 1) { isUppercase = 0; } else if(Character.isLowerCase(ch) && isLowercase == 1) { isLowercase = 0; } else if(specials.indexOf(ch) != -1 && isSpecialChar == 1) { isSpecialChar = 0; } } int sum = (isDigit + isLowercase + isUppercase + isSpecialChar); int len = n + sum; if(len >= 6) { return sum; } int needMore = 6 - len; return sum + needMore; } 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(); } }