#include <bits/stdc++.h>
using namespace std;
void action() {
  string s;
  cin >> s;
  reverse(s.begin(), s.end());
  long long c = 0, f = 0, j;
  for (long long i = 0; i < s.length(); i++) {
    if (s[i] == '1') {
      f++;
    }
    if (i % 2 == 0) c++;
  }
  if (f > 1)
    cout << c;
  else {
    if ((s.length()) % 2 == 0)
      cout << c;
    else
      cout << c - 1;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  action();
  return 0;
}
