#include using namespace std; string numbers = "0123456789"; string lower_case = "abcdefghijklmnopqrstuvwxyz"; string upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string special_characters = "!@#$%^&*()-+"; int minimumNumber(int n, string password) { int count = 0; int count2 = 0; //length 6 if(n < 6){ count2 = 6 - n; } //one digit if(password.find_first_of(numbers) == string::npos){ count +=1; } //one lowercase if(password.find_first_of(lower_case) == string::npos){ count +=1; } //one uppercase if(password.find_first_of(upper_case) == string::npos){ count +=1; } //one special if(password.find_first_of(special_characters) == string::npos){ count +=1; } return max(count, count2); // Return the minimum number of characters to make the password strong } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }