#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int pos, count = 0, erased = false;
  do {
    erased = false;
    if ((pos = s.find("01")) != -1) {
      s.erase(pos, 2);
      erased = true;
      count += 2;
    }
    if ((pos = s.find("10")) != -1) {
      s.erase(pos, 2);
      erased = true;
      count += 2;
    }
  } while (erased);
  cout << count;
  return 0;
}
