#include <bits/stdc++.h>
using namespace std;
int solve(std::vector<bool>& ss) {
  if (ss.size() <= 1) {
    return 0;
  }
  bool anyRemoved;
  int ret = 0;
  do {
    anyRemoved = false;
    for (int i = 0; i + 1 < ss.size();) {
      if (!ss[i] && ss[i + 1]) {
        ss.erase(ss.begin() + i);
        ss.erase(ss.begin() + i);
        anyRemoved = true;
        ret += 2;
      } else if (ss[i] && !ss[i + 1]) {
        ss.erase(ss.begin() + i);
        ss.erase(ss.begin() + i);
        anyRemoved = true;
        ret += 2;
      } else {
        ++i;
      }
    }
  } while (anyRemoved);
  return ret;
}
int main() {
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  std::string s;
  std::cin >> s;
  std::vector<bool> ss;
  for (auto ch : s) {
    ss.push_back(ch == '1');
  }
  std::cout << solve(ss) << std::endl;
  return 0;
}
