#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  vector<char> A;
  int f = 0;
  int ANS = 0;
  cin >> S;
  for (int i = 0; i < S.size(); i++) {
    A.push_back(S[i]);
  }
  for (int i = 0; i < A.size(); i++) {
    if (A[i] == '0') {
      f = 1;
    } else if (A[i] == '1' && f == 1) {
      A.erase(A.begin() + i);
      ANS = ANS + 2;
      f = 0;
      i = 0;
    } else {
      f = 0;
    }
  }
  cout << ANS << endl;
}
