#include #include #include #include #include #include #include int minimumNumber(int n, char* password) { // Return the minimum number of characters to make the password strong int len = strlen(password); int u=0, l=0, spl=0, dig=0,set=0; for(int i=0; i= 'a' && password[i] <= 'z' ) l=1; else if(password[i] >= 'A' && password[i] <= 'Z' ) u=1; else if(password[i] >= '0' && password[i] <= '9' ) dig=1; else spl=1; } if(u==1) set++; if(l==1) set++; if(dig==1) set++; if(spl==1) set++; if(set == 1) if(n <= 6) if(6-n > 3) return 6-n; else return 3; else return 3; if(set == 2) if(n <= 6) if(6-n > 2) return 6-n; else return 2; else return 2; if(set == 3) if(n <= 6) if(6-n > 1) return 6-n; else return 1; else return 1; if(set == 4) if(n <= 6) if(6-n > 0) return 6-n; else return 0; else return 0; else return 0; } 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; }