#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define INF numeric_limits::max() #define MINF numeric_limits::min() #define ll long long #define MOD (ll)1000000007 #define REV(X) ((X << 24) | (( X & 0xff00 ) << 8) | (( X >> 8) & 0xff00 ) | ( X >> 24 )) #define fi first #define se second int main() { #ifdef VALERA_DBG freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); #endif ll n; cin >> n; string s; cin >> s; string num = "0123456789"; string low = "abcdefghijklmnopqrstuvwxyz"; string up = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string spec = "!@#$%^&*()-+"; ll nums = 0, lows = 0, ups = 0, specs = 0; for (ll i = 0; i < n; ++i) { if (num.find(s[i]) != string::npos) ++nums; if (low.find(s[i]) != string::npos) ++lows; if (up.find(s[i]) != string::npos) ++ups; if (spec.find(s[i]) != string::npos) ++specs; } ll ans = 0; if (nums == 0) ++n, ++ans; if (lows == 0) ++n, ++ans; if (ups == 0) ++n, ++ans; if (specs == 0) ++n, ++ans; if (n < 6) ans += (6 - n); cout << ans << endl; return 0; }