#include <bits/stdc++.h>
using namespace std;
vector<bool> del(const vector<bool> &v, int &count) {
  if (v.size() == 0) return v;
  vector<bool> vv = v;
  bool prev = vv[0];
  for (int i = 1; i < vv.size(); i++) {
    if (prev != vv[i]) {
      vv.erase(vv.begin() + i - 1);
      vv.erase(vv.begin() + i - 1);
      count += 2;
    }
    prev = vv[i];
  }
  return vv;
}
int main() {
  string s;
  cin >> s;
  vector<bool> v;
  for (const auto &c : s) {
    v.push_back(c == '1');
  }
  int count = 0;
  while (true) {
    auto nv = del(v, count);
    if (nv.size() == v.size()) {
      break;
    }
    v = nv;
  }
  cout << count;
  return 0;
}
