/* * eat_code * IIIT Allahabad */ #include //#include "pretty_print.h" using namespace std; #define mp make_pair #define mt make_tuple #define pb push_back #define CONTAINS(a, x) (a.find(x) != a.end()) #define ALL(x) x.begin(), x.end() #define SZ(x) (int)x.size() #define nl cout << endl #define F first #define S second #define what_is(x) cout << #x << " = " << x << endl #define boost ios::sync_with_stdio(false);cin.tie(NULL) #define CASET int ___T, case_n = 1; cin >> ___T; while (___T-- > 0) #define rep(it, st, en) for(ll it = st; it < en; it++) #define rep1(it, st, en) for(ll it = st; it <= en; it++) #define per(it, st, en) for(ll it = en - 1; it >= st; it--) typedef long long ll; typedef pair ii; typedef pair pll; typedef vector vi; typedef vector vll; typedef vector vb; typedef vector vii; typedef vector vvi; ll INF = 1E9; ll M = 1E9 + 7; inline ll power (ll a,ll p){ ll res = 1, x = a; while ( p ) { if ( p & 1 ) res = ( res * x ); x = ( x * x ); p >>= 1; } return res; } template ostream& operator<<(ostream& os, const vector &p){os << "[ "; for (T x: p) os << x << " "; os << "]" << endl; return os;} template ostream& operator<<(ostream& os, const set &p){os << "{ "; for (T x: p) os << x << " "; os << "}" << endl; return os;} template ostream& operator<<(ostream& os, const map &p){os << "{ "; for (pair x: p) os << x << " "; os << "}" << endl; return os;} template ostream& operator<<(ostream& os, const pair &p){os << "{" << p.first << ',' << p.second << "}";return os;} int main() { boost; if(fopen("input.txt", "r")){ freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); } int n; cin >> n; string s; cin >> s; string numbers = "0123456789"; string lower_case = "abcdefghijklmnopqrstuvwxyz"; string upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string special_characters = "!@#$%^&*()-+"; vector v; v.pb(numbers); v.pb(lower_case); v.pb(upper_case); v.pb(special_characters); vi cnt(4, 0); rep(i, 0, n){ char c = s[i]; rep(j, 0, SZ(v)){ rep(k, 0, SZ(v[j])){ if(v[j][k] == c) cnt[j]++; } } } ll ans = 0; rep(i, 0, SZ(v)) if(cnt[i] == 0) ans++; if((SZ(s) + ans) < 6) ans += (6 - (SZ(s) + ans)); cout << ans << "\n"; return 0; } // Train Insane or Remain the same