#include #include #include #include #include #include #include int minimumNumber(int n, char* password) { char* numbers = "0123456789"; char* lower_case = "abcdefghijklmnopqrstuvwxyz"; char* upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; char* special_characters = "!@#$%^&*()-+"; int num = 1; int lc = 1; int uc = 1; int sc = 1; for (int i = 0; i < n; i++) { if (strchr(numbers, password[i])) num = 0; if (strchr(lower_case, password[i])) lc = 0; if (strchr(upper_case, password[i])) uc = 0; if (strchr(special_characters, password[i])) sc = 0; } int s = (num + lc + uc + sc + n < 6) ? 6 - (num + lc + uc + sc + n) : 0; return (num + lc + uc + sc + s); // Return the minimum number of characters to make the password strong } int main() { int n; scanf("%i", &n); char* password = (char *)malloc(512000 * sizeof(char)); scanf("%s", password); int answer = minimumNumber(n, password); printf("%d\n", answer); return 0; }