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