#include using namespace std; int minimumNumber(int n, string password) { string spec = "!@#$%^&*()-+"; bool len = false, number = false, lo = false, up = false, sp = false; if(password.length() >= 6) len = true; for(int i = 0; i < password.length(); i++){ if(password[i] - 'a' <= 25 && password[i] - 'a' >= 0) { lo = true; continue; } if(password[i] - 'A' <= 25 && password[i] - 'A' >= 0) { up = true; continue; } if(password[i] - '0' <= 9 && password[i] - '0' >= 0) { number = true; continue; } size_t found = spec.find(password[i]); if(found != string::npos) { sp = true; continue; } } int count = 0; if(!lo) { count++; } if(!up) { count++; } if(!number) { count++; } if(!sp) { count++; } if(password.length() + count < 6) count += (6 - password.length() - count); return count; } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }