#include #include #include #include #include #include #include int minimumNumber(int n, char* password) { // Return the minimum number of characters to make the password strong int count = 4; for (int i = 0; i < n; i++) { if (password[i] > 47 && password[i] < 58) { count--; break; } } for (int i = 0; i < n; i++) { if (password[i] > 64 && password[i] < 91) { count--; break; } } for (int i = 0; i < n; i++) { if (password[i] > 96 && password[i] < 123) { count--; break; } } for (int i = 0; i < n; i++) { if (password[i] > 32 && password[i] < 46) { count--; break; } else if (password == 64) { count--; break; } } if ((n + count) > 5) return count; else return (6 - n); } 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; }