#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const* argv[]) {
  string S;
  cin >> S;
  vector<int32_t> vec(S.length(), 0);
  for (int i = 0; i < S.length(); i++) {
    if (S[i] == '1') vec[i] = 1;
  }
  size_t sz = vec.size();
  int64_t cnt = 0;
  for (int i = 0; i < sz; i++, sz = vec.size()) {
    if ((vec[i] != vec[i + 1])) {
      vec.erase(vec.begin() + i, vec.begin() + i + 2);
      cnt += 2;
      i = -1;
    }
  }
  printf("%ld\n", cnt);
  return 0;
}
