#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  string s;
  cin >> s;
  int n = ((int)(s).size()), cnt = 0;
  bool one = false;
  for (auto i = 1; i <= (n - 1); ++i) {
    if (s[i] == '1') {
      one = true;
      break;
    }
  }
  if (one)
    cout << ceil((double)n / 2.0);
  else
    cout << ceil((double)(n - 1) / 2.0);
}
