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 numbers = "0123456789"; String lower_case = "abcdefghijklmnopqrstuvwxyz"; String upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; String special_characters = "!@#$%^&*()-+"; int num,sp,lw,up; num=sp=lw=up=0; for (int i=0;i=0) num++; else if (special_characters.indexOf(password.charAt(i))>=0) sp++; else if (lower_case.indexOf(password.charAt(i))>=0) lw++; else if (upper_case.indexOf(password.charAt(i))>=0) up++; } if (num>0&&sp>0&&lw>0&&up>0&&n>=6) return 0; else if (num>0&&sp>0&&lw>0&&up>0) return (6-n); else { int k=0; if (num==0) k++; if (sp==0) k++; if (lw==0) k++; if (up==0) k++; if (n+k>=6) return k; else return (6-n); } } 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(); } }