#include #include using namespace std; int min_operations_to_good_string(const string& S) { int operations = 0; int zero_count = 0; int one_count = 0; for (char c : S) { if (c == '0') { zero_count++; } else { one_count++; } if (zero_count > one_count) { // Fix this zero by converting it to a one operations++; zero_count--; // treat this 0 as now a 1 one_count++; } } return operations; } int main() { int n; cin >> n; string S; cin >> S; cout << min_operations_to_good_string(S) << endl; return 0; }