#include using namespace std; int minimumNumber(int n, string password) { int min = 4; string numbers = "0123456789"; string lower_case = "abcdefghijklmnopqrstuvwxyz"; string upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string special_characters = "!@#$%^&*()-+"; bool num = false,low = false, up = false,spec = false; for(int i = 0; i< n; i++){ if (numbers.find(password[i]) != std::string::npos && !num){ num=true; min--; }else if(lower_case.find(password[i]) != std::string::npos && !low){ low = true; min--; }else if(upper_case.find(password[i]) != std::string::npos && !up){ up=true; min--; }else if(special_characters.find(password[i]) != std::string::npos && !spec){ spec = true; min--; } } if(min < 6 - n){ min = 6-n; } return min; } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }