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