#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  if (n > 1 && n % 2 == 1) {
    bool ok = false;
    for (int i = 1; i < n; i++)
      if (s[i] == '1') ok = true;
    cout << n / 2 + ok << endl;
  } else {
    cout << n / 2 << endl;
  }
  return 0;
}
