#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int w = 0;
  for (int i = 0; i < (int)s.length(); i++)
    if (s[i] == '1') w++;
  if ((int)s.length() == 1) {
    cout << 0 << endl;
    exit(0);
  }
  int ans = 1 + ((int)s.length() - 1) / 2;
  if (((int)s.length() - 1) % 2 == 0 && w == 1) ans--;
  cout << ans << endl;
  return 0;
}
