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