#include using namespace std; int minimumNumber(int n, string password) { string numbers = "0123456789"; string lower_case = "abcdefghijklmnopqrstuvwxyz"; string upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string special_characters = "!@#$%^&*()-+"; int nums = 0,lower = 0, upper = 0, special = 0; int count = 0; for(char c: password){ if(numbers.find(c) != string::npos){ nums++; }else if(c >= 'a' && c <= 'z'){ lower++; }else if(c >= 'A' && c <= 'Z'){ upper++; }else if(special_characters.find(c) != string::npos){ special++; } } if(nums == 0){ count++; } if(lower == 0){ count++; } if(upper == 0){ count++; } if(special == 0){ count++; } if((count + n) < 6){ count += (6 - (count + n)); } return count; } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }