#include using namespace std; int minimumNumber(int n, string password) { // Return the minimum number of characters to make the password strong int i = 0; char c; bool lower = false; bool upper = false; bool number = false; bool special = false; int ret = 0; for (i = 0; i < password.length(); i++) { c = password.at(i); if (c >= 'a' && c <= 'z') lower = true; else if (c >= 'A' && c <= 'Z') upper = true; else if (c >= '0' && c <= '9') number = true; else if (c == '!' || c == '@' || c == '#' || c == '$' || c == '%' || c == '^' || c == '&' || c == '*' || c == '(' || c == ')' || c == '-' || c == '+') special = true; } if (lower == false) ret++; if (upper == false) ret++; if (number == false) ret++; if (special == false) ret++; if (n + ret < 6) { ret += 6 - n - ret; } return ret; } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }