#include using namespace std; std::string numbers = "0123456789"; std::string lower_case = "abcdefghijklmnopqrstuvwxyz"; std::string upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; std::string special_characters = "!@#$%^&*()-+"; int minimumNumber(int n, string password) { bool lower =false, upper = false, special = false, digit = false; auto length = password.size(); for (auto c : password) { if (std::isalpha(c)) { if (c == std::tolower(c)) { lower = true; } else { upper = true; } } else if (std::isdigit(c)) { digit = true; } else { special = true; } } int add = 0; if (!lower) add++; if (!upper) add++; if (!digit) add++; if (!special) add++; if (add + length <= 6) { add += 6 - (length + add); } return add; } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }