#include #define FAST_IO ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define pb push_back #define fi first #define se second #define mp make_pair #define all(_v) _v.begin(), _v.end() #define sz(_v) (int) _v.size() #define FIND(_obj, _val) (_obj.find(_val) != _obj.end()) #define RESET(_a, _v) fill_n(_a,sizeof(_a)/sizeof(_a[0]),_v) #define REP(_i, _n) for (int _i = 0; _i < (int) _n; _i++) #define FOR(_i, _a, _b) for (int _i = (int) _a; _i <= (int) _b; _i++) #define FORD(_i, _a, _b) for (int _i = (int) _a; _i >= (int) _b; _i--) #define FORIT(_it, _obj) for (auto _it = _obj.begin(); _it != _obj.end(); _it++) // DEBUG UTIL #define DEBUG(x) cerr << "> " << #x << " = " << x << endl using namespace std; using ll = long long; using pii = pair; using pll = pair; using pdd = pair; using vi = vector; using vii = vector; using vs = vector; const double PI = acos(-1.0); const double EPS = 1e-14; const int MOD = 1e9 + 7; const int INF = 1e9; const ll INFLL = 4e18; const int MAX = 100; int n; string s; string num = "0123456789"; string low = "abcdefghijklmnopqrstuvwxyz"; string upp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string spc = "!@#$%^&*()-+"; void read() { cin >> n >> s; } void solve() { bool num_b = false, low_b = false, upp_b = false, spc_b = false; for (char c : s) { if (num.find(c) != string::npos) num_b |= true; if (low.find(c) != string::npos) low_b |= true; if (upp.find(c) != string::npos) upp_b |= true; if (spc.find(c) != string::npos) spc_b |= true; } // DEBUG(num_b); // DEBUG(low_b); // DEBUG(upp_b); // DEBUG(spc_b); int cnt = num_b + low_b + upp_b + spc_b; int ans = 4-cnt; // DEBUG(ans); // DEBUG(cnt); cout << ans+max(0,6-n-ans) << "\n"; } int main() { FAST_IO; int TC = 1; while (TC--) { read(); solve(); } }