#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int N = S.size();
  int sum = 0;
  int c = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '1') {
      sum += 1;
    } else {
      if (sum > 0) {
        c++;
        sum--;
      }
    }
  }
  cout << 2 * c << endl;
  return 0;
}
