#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  long long st = 0;
  for (long long i = (0); i < (long long)(S.size()); i++) {
    if (S[i] == '1') {
      st++;
      continue;
    } else
      break;
  }
  long long en = 0;
  for (long long i = S.size() - 1; i >= 0; i--) {
    if (S[i] == '0') {
      en++;
      continue;
    } else
      break;
  }
  long long ans = 0;
  long long cnt0 = 0;
  long long cnt1 = 0;
  for (long long i = (st); i < (long long)(S.size() - en); i++) {
    if (S[i] == '0') cnt0++;
    if (S[i] == '1') cnt1++;
  }
  ans = 2 * min(cnt0, cnt1);
  cout << ans << endl;
  return 0;
}
