#include #define endl '\n' typedef long long LL; const int I = 1e5 + 2; const LL mod = 1e9 + 7, inf = 1e18; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); string num = "0123456789"; string lower = "abcdefghijklmnopqrstuvwxyz"; string upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string spec = "!@#$%^&*()-+"; bool isnum = false; bool islow = false; bool isup = false; bool isspec = false; int n; cin >> n; string s; cin >> s; for(char c: s) { bool pres = false; for(auto x: num) { pres |= (c == x); } isnum |= pres; pres = false; for(auto x: lower) { pres |= (c == x); } islow |= pres; pres = false; for(auto x: upper) { pres |= (c == x); } isup |= pres; pres = false; for(auto x: spec) { pres |= (c == x); } isspec |= pres; } int ans = (1 - isnum) + (1 - islow) + (1 - isup) + (1 - isspec); cout << max(ans, 6 - n) << endl; return 0; }