import java.io.*; import java.util.Scanner; class HackerRank_Strong_Password { public static void main(String args[]) throws IOException { try { Scanner sc = new Scanner (System.in) ; int n , i , capital = 0 , small = 0 , digit = 0 , special = 0 , c = 0 ; String str ; char ch ; n = sc.nextInt() ; sc.nextLine() ; str = sc.nextLine() ; for(i = 0 ; i < n ; i++) { ch = str.charAt(i) ; if(ch >= 65 && ch <=90) { capital += 1 ; } else if(ch >= 97 && ch <= 122) { small += 1 ; } else if(ch >= 48 && ch <= 57) { digit += 1 ; } else if(ch == '!' || ch == '@' || ch == '#' || ch == '$' || ch == '%' || ch == '^' || ch == '&' || ch == '*' || ch == '(' || ch == ')' || ch == '-' || ch == '+') { special += 1 ; } } if(capital == 0) { c += 1 ; } if(small == 0) { c += 1 ; } if(digit == 0) { c += 1 ; } if(special == 0) { c += 1 ; } if(capital == 0 && small == 0 && digit == 0 && special == 0) { c = (n - 2) ; } else { while((n + c) < 6) { c = c + 1 ; } } System.out.println(c) ; } catch(Exception e) { return ; } } }