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