#include #include #include #include #include #include #include int minimumNumber(int n, char* password) { //char count[256]={0}; int num=0,upper=0,lower=0,sym=0,count=0; for(int i=0;i='a'&&password[i]<='z') {if(lower==0)count++;lower++;} else if(password[i]>='A'&&password[i]<='Z') {if(upper==0)count++;upper++;} else if((password[i]>='0'&&password[i]<='9')) {if(num==0)count++;num++;} else {if(sym==0)count++;sym++;} } if(n>=6) { if(lower&&upper&&num&&sym) return 0; else if(lower&&upper&&num||lower&&upper&&sym||lower&&sym&&num||upper&&num&&sym) return 1; else if(lower&&upper||upper&&num||num&&sym||lower&&num||lower&&sym||upper&&sym) return 2; else if(lower||upper||num||sym) return 3; else return 4; } else { int d=6-n; if(d>=3) return d; else if(lower&&upper&&num&&sym) return d; else if(count==3||count==4) return d; else if(count==2&&d>=2) return d; else if(count==2&&d==1) return d+1; else if(count==2&&d==0) return d+2; else if(count==1&&d>=3) return d; else if(count==1&&d==2) return d+1; else if(count==1&&d==1) return d+2; } return 0; // Return the minimum number of characters to make the password strong } int main() { int n; scanf("%i", &n); char* password = (char *)malloc(512000 * sizeof(char)); scanf("%s", password); int answer = minimumNumber(n, password); printf("%d\n", answer); return 0; }