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 special = Pattern.matches(".*[!@#$%^&*()\\-+].*",password); boolean upper = Pattern.matches(".*[A-Z].*", password); boolean lower = Pattern.matches(".*[a-z].*", password); boolean digit = Pattern.matches(".*[0-9].*", password); int add = 0; if(!special){ add++; } if(!upper){ add++; } if(!lower){ add++; } if(!digit){ add++; } add = n+add >= 6 ? add : 6-n; return add; } 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(); } }