// g++ -std=c++11 -O2 -fmax-errors=1 #include using namespace std; typedef long long ll; typedef long double dbl; typedef pair pii; typedef vector vi; #define X first #define Y second #define mp make_pair #define pb push_back #define all(c) begin(c), end(c) #define mem(c,v) memset(c, v, sizeof c) #define uni(c) c.resize(distance(c.begin(), unique(all(c)))) #define rep(i,n) for(ll i=0, _n=(n); i<_n; i++) #define rep1(i,n) for(ll i=1, _n=(n); i<=_n; i++) #define cout(d) cout << fixed << setprecision(d) #define err(x) cerr << #x << " = " << x << "\n" #define cases int _t_; cin >> _t_; rep1(_t,_t_) #define coutt cout << "Case " << _t << ": " #define io ios_base::sync_with_stdio (false); cin.tie(NULL); const dbl eps=1e-12, pi=acosl(-1); const ll inf=1e16, mod=1e9+7; const int N=2e6+10; int main() { // freopen("a.in", "r", stdin); // freopen("a.out", "w", stdout); int n; cin >> n; string s; cin >> s; int low=0; for(char c: s) if(islower(c)) low++; int up=0; for(char c: s) if(isupper(c)) up++; int dig=0; for(char c: s) if(isdigit(c)) dig++; int sp=n-low-up-dig; int ans=0; if(low==0) ans++; if(up==0) ans++; if(dig==0) ans++; if(sp==0) ans++; while(n+ans<6) ans++; cout << ans; return 0; }