#include #define ll long long #define ld long double #define ull unsigned ll #define F first #define S second #define mp make_pair #define pb push_back #define div codeforces using namespace std; const int MIN = 2e3 + 2; const int MXN = 3e5 + 2; const int INF = 1e9 + 7; const ll LINF = 1e18 + 15; const double EPS = 1e-9; int n, ans = 4; string st, s = "!@#$%^&*()-+"; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); //freopen ("abay.in", "r", stdin); //freopen ("abay.out", "w", stdout); cin >> n >> st; for (int i = 0; i < st.size(); ++i){ if (isdigit(st[i])){ ans--; break; } } for (int i = 0; i < st.size(); ++i){ if (isupper(st[i])){ ans--; break; } } for (int i = 0; i < st.size(); ++i){ if (islower(st[i])){ ans--; break; } } for (int i = 0; i < st.size(); ++i){ bool ok = 1; for (int j = 0; j < s.size(); ++j){ if (s[j] == st[i]){ ans--; ok = 0; break; } } if (!ok){ break; } } cout << max (0, max (ans, 6 - n)); return 0; }