#include <bits/stdc++.h>
using namespace std;
using Int = long long int;
using UInt = unsigned long long int;
using VI = vector<long long int>;
int main(void) {
  string s;
  cin >> s;
  Int length = (Int)s.length();
  Int result = length;
  for (Int i = 0; i < length; ++i) {
    if (s[i] == '1') {
      result--;
    } else {
      break;
    }
  }
  for (Int i = length - 1; i >= 0; --i) {
    if (s[i] == '0') {
      result--;
    } else {
      break;
    }
  }
  cout << result << endl;
  return 0;
}
