#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int N = S.length();
  int k = 0;
  int t = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '0') {
      k = i;
      t += 1;
      break;
    }
  }
  if (t == 0) {
    cout << 0 << endl;
  } else {
    int l = 0;
    while (k < N) {
      if (S[k] == '0' && S[k + 1] == '1') {
        for (int j = k; j < N; j++) {
          S[j] = S[j + 2];
        }
        l += 2;
        k -= 1;
      } else {
        k += 1;
      }
    }
    cout << l << endl;
  }
  return 0;
}
