#include <bits/stdc++.h>
using namespace std;
int main() {
  bitset<64> bt = 64;
  ios::sync_with_stdio(0);
  string str;
  cin >> str;
  long long tmp = str.size();
  long long ans = (tmp + 1) / 2;
  bool fuck = true;
  for (string::iterator it = str.begin() + 1, ed = str.end(); it != ed; ++it) {
    if (*it == '1') {
      fuck = false;
    }
  }
  if (fuck && tmp % 2) ans--;
  cout << ans << endl;
  return 0;
}
