#include #include #include #include #define typ long long int using namespace std; inline typ max(typ a, typ b) { return a > b ? a : b; } inline typ min(typ a, typ b) { return a < b ? a : b; } int main() { ios::sync_with_stdio(false); typ N; cin >> N; string S; cin >> S; bool len, dig, low, up, sp; len = dig = low = up = sp = false; len = S.length() >= 6 ? true : false; for(char ch : S) { if(isdigit(ch)) dig = true; else if(islower(ch)) low = true; else if(isupper(ch)) up = true; else if(ch=='!'||ch=='@'||ch=='#'||ch=='$'||ch=='%'||ch=='^'||ch=='&'||ch=='*'||ch=='('||ch==')'||ch=='-'||ch=='+') sp = true; } int need = 0; if(!sp) ++need; if(!up) ++need; if(!low) ++need; if(!dig) ++need; if(S.length()+need < 6) need += 6-(S.length()+need); cout << need << endl; return 0; }