#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int first_size = s.size();
  bool flg = true;
  while (flg) {
    auto itr1 = s.find("01");
    if (itr1 != string::npos) {
      s.erase(itr1, 2);
    } else {
      auto itr2 = s.find("10");
      if (itr2 != string::npos) {
        s.erase(itr2, 2);
      } else {
        flg = false;
      }
    }
  }
  cout << first_size - s.size() << endl;
  return 0;
}
