#include using namespace std; int minimumNumber(int n, string password) { bool lower = false, upper = false, number = false, special = false; string specialChars = "!@#$%^&*()-+"; for(int i = 0; i < password.length(); i++){ if(password[i] >= '0' && password[i] <= '9'){ number = true; } if(password[i] >= 'a' && password[i] <= 'z'){ lower = true; } if(password[i] >= 'A' && password[i] <= 'Z'){ upper = true; } for(int j = 0; j < specialChars.length(); j++){ if(password[i] == specialChars[j]){ special = true; break; } } } int extraChar = !lower + !upper + !number + !special; return (n + extraChar >= 6 ? extraChar : 6 - n); } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }