#include using namespace std; string special = "!@#$%^&*()-+"; int minimumNumber(int n, string p) { int ans = 0; for (auto c : p) { if ('a' <= c && c <= 'z') { ans++; break; } } for (auto c : p) { if ('0' <= c && c <= '9') { ans++; break; } } for (auto c : p) { if ('A' <= c && c <= 'Z') { ans++; break; } } for (auto c : p) { bool yes = false; for (auto x : special) if (x == c) { yes = true; break; } if (yes) { ans++; break; } } return (4 - ans) + (4-ans+p.length() >= 6 ? 0 : 2 + ans - p.length()); } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }