#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<char> tower;
  for (auto x : s) {
    tower.push_back(x);
  }
  int ans = 0;
  bool found0 = false;
  bool found1 = false;
  for (int i = 0; i < tower.size(); i++) {
    if (tower[i] == '1') {
      found1 = true;
    } else {
      found0 = true;
    }
  }
  if ((found1 && !found0) || (found0 && !found1)) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 0; i < tower.size(); i++) {
    if (tower.size() <= 1) {
      break;
    }
    if (tower[i] != tower[i + 1]) {
      tower.erase(tower.begin() + i);
      tower.erase(tower.begin() + i);
      ans += 2;
      i = -1;
    }
  }
  cout << ans << endl;
  return 0;
}
