#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n, m = 0;
  cin >> s;
  n = s.size() - 1;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '1') m++;
  }
  if (m > 1)
    cout << n / 2 + 1 << endl;
  else
    cout << (n + 1) / 2 << endl;
  return 0;
}
