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