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 boolean num= false; boolean lowerCase= false; boolean upperCase= false; boolean special= false; for(int i=0; i='0' && ch<='9') { num= true; } else if(ch>='a' && ch<='z') { lowerCase= true; } else if(ch>='A' && ch<='Z') { upperCase= true; } else if(ch=='!' || ch=='@' || ch=='#'|| ch=='$'|| ch=='%'|| ch=='^'|| ch=='&'|| ch=='*'|| ch=='('|| ch==')'|| ch=='-'|| ch=='+') { special=true; } } int count=0; if(!num) count++; if(!lowerCase) count++; if(!upperCase) count++; if(!special) count++; if(n+count <6) { return 6-n; }else { 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(); } }