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 count1=0,count2=0,count3=0,count4=0,c=0; for(int i=0;i=65 && x<=90) { count1++; } if(x>=97 && x<=122) { count2++; } if(x>=48 && x<=57) { count3++; } if(ch=='+' || ch=='-' || ch=='(' || ch==')' || ch=='*' || ch=='^' || ch=='$' || ch=='#' || ch=='@' || ch=='!') { count4++; } } if(password.length()>6) { if(count1==0) { c++; } if(count2==0) { c++; } if(count3==0) { c++; } if(count4==0) { c++; } return c; } else { int dif=6-password.length(); if(count1==0) { c++; } if(count2==0) { c++; } if(count3==0) { c++; } if(count4==0) { c++; } if(c>=dif) { return c; } else { return c+(dif-c); } }// Return the minimum number of characters to make the password strong } 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(); } }