#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, count = 0, count2 = 0, index;
  string str;
  cin >> str;
  reverse(str.begin(), str.end());
  for (i = 0; i < str.length(); i++) {
    if (str[i] == '1') count2++;
    if (str[i] == '1') {
      if (i % 2 == 0)
        count = i / 2;
      else
        count = ceil(i * 1.0 / 2);
      index = i;
    }
  }
  if (count2 > 1 && index % 2 == 0) count++;
  cout << count;
}
