#include using namespace std; string numbers = "0123456789"; string lower_case = "abcdefghijklmnopqrstuvwxyz"; string upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string special_characters = "!@#$%^&*()-+"; bool specialFind(char c){ for(int i = 0; i < 12; i++){ if(special_characters[i] == c){ return true; } } return false; } int minimumNumber(int m, string password) { // Return the minimum number of characters to make the password strong bool n = false, l = false, u = false, s = false; int i = 0; while(password[i]){ if(!n && password[i] >= '0' && password[i] <= '9'){ n = true; } if(!l && password[i] >= 'a' && password[i] <= 'z'){ l = true; } if(!u && password[i] >= 'A' && password[i] <= 'Z'){ u = true; } if(!s && specialFind(password[i])){ s = true; } i++; } int result = 4 - int(n) - int(l) - int(u) - int(s); if(result + m < 6){ result = 6 - m; } return result; } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }