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 = 4; for (char c : "0123456789".toCharArray()){ if (password.indexOf(c) != -1){ num -= 1; break; } } for (char c : "abcdefghijklmnopqrstuvwxyz".toCharArray()){ if (password.indexOf(c) != -1){ num -= 1; break; } } for (char c : "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray()){ if (password.indexOf(c) != -1){ num -= 1; break; } } for (char c : "!@#$%^&*()-+".toCharArray()){ if (password.indexOf(c) != -1){ num -= 1; break; } } if (n + num < 6) { num += 6-(n+num); } return num; } 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(); } }