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