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 num=0,cap=0,small=0,special=0; for(int i=0;i=65&&ch<=90) cap++; if(ch>=97&&ch<=122) small++; if(ch=='!'||ch=='@'||ch=='#'||ch=='$'||ch=='%'||ch=='^'||ch=='&'||ch=='*'||ch=='('||ch==')'||ch=='-'||ch=='+') special++; } int answer=0; if(num==0) answer++; if(cap==0) answer++; if(small==0) answer++; if(special==0) answer++; if((n+answer)<6) answer=answer+(6-(n+answer)); return answer; } 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(); } }