#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long count = 0;
  bool found = false;
  count = (s.length() / 2) + (s.length() % 2);
  if ((s.length() % 2)) {
    for (int i = s.length() - 1; i > 0; i--) {
      if (s[i] - 48) {
        found = true;
      }
    }
    count -= !found;
  }
  cout << count << endl;
}
