#include using namespace std; int minimumNumber(int n, string password) { // Return the minimum number of characters to make the password strong int i =0; std::string specialChars = "!@#$%^&*()-+"; int digit=1, upper=1, lower =1, special =1; int length = password.length(); char curr; while(password[i]!=0){ curr = password[i]; if(curr>='0' && curr<='9'){ digit =0; } else if (curr>='a' && curr<='z'){ lower = 0; } else if (curr>='A' && curr<='Z'){ upper = 0; }else if (specialChars.find(curr)!=std::string::npos){ special =0; } if(digit==1 && upper==1 && lower ==1 && special ==1 && length >=6){ return 0; } i++; } if(length >= 6){ return digit+upper+lower+special; }else{ if(length<=2){ return 6-length; }else if(digit+upper+lower+special>6-length){ return digit+upper+lower+special; } else{ return 6-length; } } } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }