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 lower= 1, upper =1,num = 1,sym = 1; for(int i = 0; i < password.length();i++){ char c = password.charAt(i); if( c >= 'a' && c <= 'z')lower=0; if( c >= 'A' && c <= 'Z')upper=0; if( c >= '0' && c <= '9')num=0; if( c == '!' || c=='@' || c == '#' || c == '$' || c =='%' || c == '^' || c == '&' || c == '*' || c== '(' || c == ')' || c =='-' || c== '+') sym = 0; } int add = upper + lower+ num +sym; return password.length() + add < 6 ? 6 - password.length() : add; } 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(); } }