#include #include #include #include #include #include using namespace std; const string numbers = "0123456789"; const string lower_case = "abcdefghijklmnopqrstuvwxyz"; const string upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; const string special_characters = "!@#$%^&*()-+"; bool contains(const string &s, const string &p) { for (auto c : s) if (p.find(c) != string::npos) return true; return false; } int solve(const string &pw) { int ans = 0; if (!contains(pw, numbers)) ++ans; if (!contains(pw, lower_case)) ++ans; if (!contains(pw, upper_case)) ++ans; if (!contains(pw, special_characters)) ++ans; if (pw.size() + ans < 6) return 6 - pw.size(); return ans; } int main(void) { cout.sync_with_stdio(false); int n; string pw; cin >> n >> pw; cout << solve(pw) << endl; return 0; }