#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b, c, d, e, f, g, h, i;
  string A;
  cin >> A;
  b = 0;
  c = A.length();
  for (a = (A.length() - 1); a > 0; a--) {
    if (A[a] == '1') {
      b = 1;
      break;
    }
  }
  if (c % 2 == 0) {
    d = c / 2;
  } else {
    if (b == 1) {
      d = c / 2 + 1;
    } else {
      d = c / 2;
    }
  }
  cout << d << endl;
}
