#include using namespace std; int n; string s; int ans; bool dig, lower, upper, special; set c; int main() { cin >> n >> s; ans = max(0, 6-n); string t = "!@#$%^&*()-+"; for (int i = 0; i < 12; i++) c.insert(t[i]); for (int i = 0; i < n; i++) { if (s[i] >= '0' && s[i] <= '9'){ dig = true; } if (s[i] >= 'a' && s[i] <= 'z') { lower = true; } if (s[i] >= 'A' && s[i] <= 'Z') { upper = true; } if (c.find(s[i]) != c.end()) { special = true; } } ans = max(ans, (!dig) + (!lower) + (!upper) + (!special)); cout << ans << endl; return 0; }