#include <bits/stdc++.h>
using namespace std;
string S;
bool BS[10100];
int length = 0;
int res = 0;
int deleteCube(int index) {
  int i;
  for (i = index + 2; i != length; ++i) {
    BS[i - 2] = BS[i];
  }
  length -= 2;
  return 0;
}
bool searchCube() {
  for (int i = 0; i != length; ++i) {
    if ((!BS[i] and BS[i + 1]) or (BS[i] and !BS[i + 1])) {
      deleteCube(i);
      res += 2;
      return true;
    }
  }
  return false;
}
int main() {
  cin >> S;
  for (int i = 0; i < S.length(); ++i) {
    BS[i] = (S[i] == '1');
    length++;
  }
  while (true) {
    if (!searchCube()) break;
  }
  cout << res << endl;
  return 0;
}
