#include using namespace std; int main() { int n; string s; cin >> n >> s; bool lower = false, upper = false, special = false, digit = false; for (int i = 0; i < n; i++) if (s[i] >= 'a' && s[i] <= 'z') lower = true; else if (s[i] >= 'A' && s[i] <= 'Z') upper = true; else if (s[i] >= '0' && s[i] <= '9') digit = true; else if (string("!@#$%^&*()-+").find(s[i]) != string::npos) special = true; int ans = int(!lower) + int(!upper) + int(!special) + int(!digit); while (ans + n < 6) ans++; cout << ans << endl; }