#include using namespace std; int minimumNumber(int n, string password) { // Return the minimum number of characters to make the password strong //check for lower case, upper case, special chars. bool lowerCase=false,upperCase=false,specialChar=false,number=false; for(char ch : password) { if('a' <= ch && 'z' >=ch) lowerCase=true; else if('A' <= ch && 'Z' >=ch) upperCase=true; else if('0' <= ch && '9' >=ch) number=true; else if(ch=='"' || ch=='!' || ch=='@'|| ch=='#'|| ch=='$'|| ch=='%'|| ch=='^'|| ch=='&'|| ch=='*'|| ch=='(' || ch=='+'|| ch=='-'|| ch==')') specialChar=true; //"!@#$%^&*()-+" } int num = 0; if(lowerCase == false) num++; if(upperCase == false) num++; if(number == false) num++; if(specialChar == false) num++; if(password.length() +num <6) return 6 - password.length(); return num; } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }