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