#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; bool FindNeedSymbol(const string& password, const string& compare) { int i = 0; for (; i < compare.size(); ++i) { auto found = password.find(compare[i]); if (found != std::string::npos) break; } if (i == compare.size()) return true; return false; } int minimumNumber(int n, string password) { string numbersStr = "0123456789"; string lower_caseStr = "abcdefghijklmnopqrstuvwxyz"; string upper_caseStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string special_charactersStr = "!@#$%^&*()-+"; int needSymbol = 0; if (FindNeedSymbol(password, numbersStr)) ++needSymbol; if (FindNeedSymbol(password, lower_caseStr)) ++needSymbol; if (FindNeedSymbol(password, upper_caseStr)) ++needSymbol; if (FindNeedSymbol(password, special_charactersStr)) ++needSymbol; int needAdd = 0; if (password.size() < 6) { needAdd = 6 - password.size(); } if (needAdd > needSymbol) return needAdd; return needSymbol; } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }