#include #include using namespace std; int minimumNumber(int n, string password) { // Return the minimum number of characters to make the password strong int count = 0; bool islower = false,isupper = false,isNumber = false,isSpecial = false; for(int i = 0; i < password.length();i++) { if(password[i] >= 65 && password[i] <= 90 ) { islower = true; break; } } for(int i = 0; i < password.length();i++) { if(password[i] >= 97 && password[i] <= 122 ) { isupper = true; break; } } for(int i = 0; i < password.length();i++) { if(password[i] >= 48 && password[i] <= 57 ) { isNumber = true; break; } } for(int i = 0; i < password.length();i++) { 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] == '+' ) { isSpecial = true; break; } } if(!islower) count++; if(!isupper) count++; if(!isNumber) count++; if(!isSpecial) count++; if((password.length() + count) < 6) { int rem = 6 - (password.length() + count); count = count + rem; } return count; } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }