/* ------------------------------------------------- Author :- Vaibhav Pal College :- Northern India Engineering College, New Delhi Coding Handle :- underdog_eagle Title :- ----------------------------------------------------*/ #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair ii; typedef vector vii; typedef vector vi; typedef vector vvi; #define FAST_IO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define INF 1000000000000000000 // 10^18 #define nl '\n' #define sp ' ' #define pb push_back #define mp make_pair #define mt make_tuple #define F first #define S second #define fo(i, a, b) for(int (i) = (a); (i) <= (b); (i)++) ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); } ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); } int main() { FAST_IO /*#ifndef ONLINE_JUDGE freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); #endif */ int n; cin >> n; string str, str1 = "!@#$%^&*()-+"; cin >> str; bool a = 0, b = 0, c = 0, d = 0; fo(i, 0, n - 1) { if (str[i] >= 'a' && str[i] <= 'z') a = 1; if (str[i] >= 'A' && str[i] <= 'Z') b = 1; fo(j, 0, str1.length() - 1) { if (str[i] == str1[j]) { c = 1; break; } } if (str[i] >= '0' && str[i] <= '9') d = 1; } if (n >= 6) { int ans = 0; if (!a) ans++; if (!b) ans++; if (!c) ans++; if (!d) ans++; cout << ans; } else { int ans = 0; int diff = 6 - n; if (!a && diff) diff--, ans++; else if (!a && !diff) ans++; if (!b && diff) diff--, ans++; else if(!b && !diff)ans++; if (!c && diff) diff--, ans++; else if(!c && !diff)ans++; if (!d && diff) diff--, ans++; else if (!d && !diff) ans++; ans += diff; cout << ans; } return 0; }