#include #include #include #include #include using namespace std; char s[110]; bool specl(char c) { return (c == '!' || c == '@' || c == '#' || c == '$' ||c == '%' || c == '^' || c == '&' || c == '*' || c == '(' || c == ')' || c == '-' || c == '+'); } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int n; cin >> n; scanf("%s", s); int num = 0, spl = 0, lc = 0, uc = 0; for (int i = 0 ; i < n ; ++i) { if ('0' <= s[i] && s[i] <= '9') num = true; if (specl(s[i])) spl = true; if (s[i] <= 'z' && s[i] >= 'a') lc = true; if (s[i] <= 'Z' && s[i] >= 'A') uc = true; } int def = (num ^ 1) + (spl ^ 1) + (lc ^ 1) + (uc ^ 1); cout << max(6 - n, def)<< endl; return 0; }