#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  long long n = s.size();
  long long cnt = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '1') cnt++;
  }
  if (s == "0")
    cout << "0";
  else if (cnt < 2) {
    cout << n / 2;
  } else if (cnt >= 2) {
    cout << (n + 1) / 2;
  } else {
    cout << n;
  }
  return 0;
}
