#include using namespace std; bool appears(char c) { string s = "!@#$%^&*()-+"; for (auto it : s) if (it == c) return true; return false; } int minimumNumber(int n, string password) { bool dig = false; bool lc = false; bool uc = false; bool sc = false; for (int i = 0; i < n; ++i) { if (isdigit(password[i])) dig = true; if (password[i] >= 'a' && password[i] <= 'z') lc = true; if (password[i] >= 'A' && password[i] <= 'Z') uc = true; if (appears(password[i])) sc = true; } int add = 0; add += !dig; add += !lc; add += !uc; add += !sc; add += max(0, 6 - n - add); return add; } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }