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