#include using namespace std; int main() { //freopen("input", "r", stdin); //freopen("output", "w", stdout); int n; cin >> n; char s[1000]; scanf("%s", s); int len = strlen(s), f1 = 1, f2 = 1, f3 = 1, f4 = 1; string str = "!@#$%^&*()-+"; for (int i = 0; i < len; ++i) { char c = s[i]; if (c >= '0' && c <= '9') f1 = 0; if (c >= 'a' && c <= 'z') f2 = 0; if (c >= 'A' && c <= 'Z') f3 = 0; if (str.find(c) != string::npos) f4 = 0; } n += f1 + f2 + f3 + f4; int t = max(0, 6 - n); cout << t + f1 + f2 + f3 + f4 << endl; return 0; }