#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int res = (s.length() - 1) / 2;
  string s1 = s.substr(0, s.length() - 2 * res);
  string s2 = s;
  s2.erase(0, s1.length());
  if (s1 == "1") {
    if (count(s2.begin(), s2.end(), '1')) res++;
  } else
    res++;
  if (s == "0") res = 0;
  cout << res;
  return 0;
}
