#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  while (cin >> str) {
    int last1 = -1, cnt1s = 0;
    for (int i = 0; i < str.length(); i++) {
      if (str[i] == '1') {
        if (last1 == -1) last1 = i;
        cnt1s += 1;
      }
    }
    if (cnt1s == 0) {
      cout << 0 << "\n";
      continue;
    }
    last1 = str.length() - last1 - 1;
    if (last1 % 2 == 1) last1 += 1, cnt1s = 0;
    last1 = last1 / 2;
    if (cnt1s > 1) last1 += 1;
    cout << last1 << "\n";
    break;
  }
  return 0;
}
