#include using namespace std; int minimumNumber(int n, string password) { //numbers = "0123456789" //lower_case = "abcdefghijklmnopqrstuvwxyz" //upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" //special_characters = "!@#$%^&*()-+" bool digit = false, lower = false, upper = false, special = false; int sz = password.size(); for(int i = 0; i < sz; i++) { int cc = password[i]; char c = password[i]; if (!digit && cc >= 48 && cc < 58) digit = true; if (!lower && cc >= 97 && cc < 123) lower = true; if (!upper && cc >= 65 && cc < 91) upper = true; if (!special && ( c == '!' || c == '@' || c == '#' || c == '$' || c == '%' || c == '^' || c == '&' || c == '*' || c == '(' || c == ')' || c == '-' || c == '+')) special = true; } int initial = 0; if (!digit) { initial++; }if (!lower) { initial++; }if (!upper) { initial++; }if (!special) { initial++; } if (sz + initial < 6) return 6-sz; return initial; // 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; }