#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<char> ar;
  vector<char>::iterator it, p, q;
  char s[100];
  scanf("%s", s);
  int l = strlen(s);
  int i, c = 0;
  for (i = 0; i < l; ++i) {
    ar.push_back(i);
  }
  for (it = ar.begin(); it != ar.end();) {
    if ((*it == 1 && *(it + 1) == 0) || (*it == 0 && *(it + 1) == 1)) {
      c += 2;
      p = it;
      q = it + 1;
      ar.erase(p);
      ar.erase(p);
      --it;
    } else
      ++it;
  }
  cout << c << '\n';
  return 0;
}
