#include using namespace std; #define sqr(x) ((x) * (x)) #define pb push_back #define mp make_pair #define X first #define Y second #define fin(name) freopen(name, "r", stdin) #define fout(name) freopen(name, "w", stdout) #define I(x, a) for(auto x : a) #define F(i, l, r) for(auto i = l; i != r; ++i) #define DF(i, l, r) for(auto i = l; i != r; --i) #define clean(a) memset((a),0,sizeof (a)) #define sync ios_base::sync_with_stdio(0);cin.tie(0) #define all(x) x.begin(),x.end() #define ret return #define cont continue #define brk break #define ins insert #define sz(a) ((int)(a).size()) typedef long long ll; typedef unsigned long long ull; typedef long double dbl; typedef pair pii; const int inf = (int)1e9; const ll linf = (ll)1e18; const int mod = (int) 1e9 + 7; const dbl eps = (dbl) 1e-8; const int maxn = (int) 1e5 + 5; const dbl pi = acos(-1); string numbers = "0123456789"; string lower_case = "abcdefghijklmnopqrstuvwxyz"; string upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string special_characters = "!@#$%^&*()-+"; int main() { // fin("t.in"); sync; int n; string s; int f_num = 0, f_low = 0, f_up = 0, f_sp = 0; cin >> n; cin >> s; F(j, 0, n) { F(i, 0, sz(numbers)) if (s[j] == numbers[i]) f_num = 1; F(i, 0, sz(lower_case)) if (s[j] == lower_case[i]) f_low = 1; F(i, 0, sz(upper_case)) if (s[j] == upper_case[i]) f_up = 1; F(i, 0, sz(special_characters)) if (s[j] == special_characters[i]) f_sp = 1; } cout << max(!f_sp + !f_low + !f_up + !f_num, 6 - sz(s)) << endl; return 0; }