// Bismillahirohmanirohiim #include using namespace std; #define ios ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define mod %1000000007 #define moz 1000000007 #define nl "\n" #define S second #define F first #define PB push_back #define MP make_pair #define V vector #define P pair #define LEN length() #define SZ size() #define fop(i,a,b) for(int (i)=(a);(i)<=(b);(i)++) typedef long long ll; //typedef complex C; //#define X real() //#define Y imag() //const double EPS = 1e-9 ; char uniq[12]={'!','@','#','$','%','^','&','*','(',')','-','+'}; int main() { ios; int ans=0; int n; string s; cin >> n ; cin >> s ; if(n<6) { ans=6-n; } bool kecil=0; bool besar=0; bool digit=0; bool unik=0; fop(i,0,n-1) { if(s[i]>=65 && s[i]<=90) besar=1; if(s[i]>=97 && s[i]<=122) kecil=1; if(s[i]>=48 && s[i]<=57) digit=1; if(!unik) fop(j,0,11) { if(s[i]==uniq[j]) unik=1; } } if(ans>0) { int x=0; if(!besar) x++; if(!kecil) x++; if(!unik) x++; if(!digit) x++; if(x>ans) { ans=x; } } else { if(!digit) ans++; if(!besar) ans++; if(!kecil) ans++; if(!unik) ans++; } cout << ans << nl; }