#include using namespace std; int minimumNumber(int n, string password) { string numbers = "0123456789"; string lower_case = "abcdefghijklmnopqrstuvwxyz"; string upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string special_characters = "!@#$%^&*()-+"; bool hasNumber = false; bool hasLower = false; bool hasUpper = false; bool hasSpecial = false; int x = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < numbers.length(); ++j)if (password[i] == numbers[j]) hasNumber = true; for (int j = 0; j < lower_case.length(); ++j)if (password[i] == lower_case[j]) hasLower = true; for (int j = 0; j < upper_case.length(); ++j)if (password[i] == upper_case[j]) hasUpper = true; for (int j = 0; j < special_characters.length(); ++j)if (password[i] == special_characters[j]) hasSpecial = true; } if (!hasNumber) x++; if (!hasLower) x++; if (!hasUpper) x++; if (!hasSpecial) x++; if (n < 6) x = max(6 - n, x); return x; } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }