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