/*Template by hemnath_d(Enlightened by chamow)*/ #include using namespace std; /*--------------------------------------------------------------*/ typedef long long ll; typedef long double ld; typedef vector vec; typedef vector vi; typedef pair pll; typedef pair pii; /*--------------------------------------------------------------*/ #define fastread ios_base::sync_with_stdio(false); cin.tie(NULL); #define pb push_back #define mp make_pair #define fx first #define sx second #define forw(i,a,n) for(i=a;i<=n;i++) #define rev(i,a,n) for(i=a;i>=n;i--) #define For(i,a,n) for(i=a;in;i--) #define inf 100000000000000 #define minf -100000000000000 /*--------------------------------------------------------------*/ //Function to add an edge for graph //Undirected graph void add_edge(vec adj[],ll a,ll b) { adj[a].pb(b); adj[b].pb(a); } /*---------------------------------------------------------------*/ //Comparator class for min-heap using priority_queue //Change the parameters before use class myComparator { public: int operator() (/*Datatype*/int p1,/*Datatype*/int p2) { return p1/*value*/ > p2/*value*/; } }; /*----------------------------------------------------------------*/ //END OF TEMPLATE /*----------------------------------------------------------------*/ string a="abcdefghijklmnopqrstuvwxyz"; string b="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string c="!@#$%^&*()-+"; string d="0123456789"; int main() { fastread; ll n; cin>>n; string s; cin>>s; ll i; ll ca=0,cb=0,cc=0,cd=0; For(i,0,n) { ll j; For(j,0,a.size()) if(s[i]==a[j]) ca++; For(j,0,b.size()) if(s[i]==b[j]) cb++; For(j,0,c.size()) if(s[i]==c[j]) cc++; For(j,0,d.size()) if(s[i]==d[j]) cd++; } ll regdig=6-s.size(); if(s.size()>=6) regdig=minf; ll k=0; if(ca==0) k++; if(cb==0) k++; if(cc==0) k++; if(cd==0) k++; regdig=max(k,regdig); cout<