#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  cin >> s;
  int t = (s.size() - 1) / 2 + 1;
  bool ok = 1;
  if (s.size() % 2 == 1) {
    for (int i = 1; i < s.size(); i++)
      if (s[i] == '1') {
        ok = 0;
      }
  } else
    ok = 0;
  cout << t - ok;
  return 0;
}
