#include using namespace std; int minimumNumber(int n, string password) { bool digit = false; bool lower = false; bool upper = false; bool special = false; for (char c : password) { if (c >= 'a' && c <= 'z') { lower = true; } else if (c >= 'A' && c <= 'Z') { upper = true; } else if (c >= '0' && c <= '9') { digit = true; } else { special = true; } } return max(!digit + !lower + !upper + !special, 6 - n); } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }