#include <bits/stdc++.h>
using namespace std;
int main() {
  long i, j, k, l;
  string s;
  cin >> s;
  vector<bool> str;
  str.clear();
  list<int> list;
  list.clear();
  for (i = 0; i < s.length(); i++) {
    str.push_back(s[i] == '0');
    list.push_back(i);
  }
  bool flg;
  j = 0;
  auto itr = list.begin();
  auto nex = itr;
  while (true) {
    flg = false;
    if (list.size() <= 1) break;
    for (itr = nex = list.begin(), nex++, i = 0; i < list.size() - 1;
         i++, itr++, nex++) {
      if (str[(*itr)] != str[*(nex)]) {
        list.erase(nex);
        list.erase(itr);
        j++;
        flg = true;
        break;
      }
    }
    if (!flg) break;
  }
  printf("%ld", j * 2);
  return 0;
}
