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 String s1 = "!@#$%^&*()-+"; char[] sc = new char[12]; for(int i=0; i<12; i++) sc[i] = s1.charAt(i); boolean d=false, u=false, l=false, s=false; for(int i=0; i=0 && ch - 'A' <= 25) u = true; else if(ch - 'a' >=0 && ch - 'a' <=25) l = true; else if(ch - '0' >=0 && ch - '0' <= 9) d = true; for(int j=0; j<12; j++) { if(ch == sc[j]) s = true; } } //System.out.println(u + " " + l + " " + d + " " + s); int count = password.length(), c=0; if(!d) { count++; c++; } if(!u) { count++; c++; } if(!l) { count++; c++; } if(!s) { count++; c++; } if(count>=6) return c; else return c + (6-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(); } }