#include using namespace std; int minimumNumber(int n, string password) { // Return the minimum number of characters to make the password strong int lc=0; int uc=0; int d=0; int sc=0; for(int i=0;password[i]!='\0';i++) { if(password[i]>='a'&&password[i]<='z') lc++; else if(password[i]>='A'&&password[i]<='Z') uc++; else if(password[i]>='0'&&password[i]<='9') d++; //!@#$%^&*()-+ else if(password[i]=='!'||password[i]=='@'||password[i]=='#'||password[i]=='$'||password[i]=='%'||password[i]=='^'||password[i]=='&'||password[i]=='*'||password[i]=='('||password[i]==')'||password[i]=='-'||password[i]=='+') sc++; } int c=0; if(lc==0) c++; if(uc==0) c++; if(d==0) c++; if(sc==0) c++; if(n>=6) { return c; } else { if(6-n>c) return 6-n; else return c; } } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }