#include <bits/stdc++.h>
using namespace std;
bool comp(int lhs, int rhs) { return abs(lhs) < abs(rhs); }
int main() {
  string s;
  cin >> s;
  int n = s.length(), i;
  if ((n - 1) % 2 == 1) {
    cout << (n - 1) / 2 + 1;
  } else {
    for (i = 1; i < n; i++) {
      if (s[i] == '1') break;
    }
    if (i == n) {
      cout << (n - 1) / 2;
    } else {
      cout << (n - 1) / 2 + 1;
    }
  }
  return 0;
}
