#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  bool check = false;
  int last = -1, cnts = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '1') {
      if (last == -1) last = i;
      cnts++;
    }
  }
  if (cnts == 0) {
    cout << 0 << endl;
    check = true;
  }
  if (!check) {
    last = s.size() - last - 1;
    if (last % 2 == 1) {
      last++;
      cnts = 0;
    }
    last = last / 2;
    if (cnts > 1) last++;
    cout << last << endl;
  }
  return 0;
}
