#include using namespace std; int minimumNumber(int n, string password) { // Return the minimum number of characters to make the password strong int count=0; int c=0; int c1=0; int c2=0; int c3=0; string numbers = "0123456789"; string lower_case = "abcdefghijklmnopqrstuvwxyz"; string upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string special_characters = "!@#$%^&*()-+"; for(int i=0;i<10;i++){ char a= numbers[i]; if(password.find(numbers[i]) != std::string::npos){ c=1; break; } } if(c!=1) count ++; //cout << count << endl; for(int i=0;i<26;i++){ char a= lower_case[i]; if(password.find(lower_case[i]) != std::string::npos){ c1=1; break; } } if(c1!=1) count ++; //cout << count << endl; for(int i=0;i<26;i++){ char a= upper_case[i]; if(password.find(upper_case[i]) != std::string::npos){ c2=1; break; } } if(c2!=1) count ++; // cout << count << endl; for(int i=0;i<12;i++){ char a= special_characters[i]; if(password.find(special_characters[i]) != std::string::npos){ c3=1; break; } } if(c3!=1) count ++; //cout << count << endl; if(n+count < 6) count = count + 6-(n+count); return count; } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }