#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  if (s == "0") {
    printf("0\n");
    return 0;
  }
  int ans = 1;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '1') {
      ans += (s.length() - i - 1) / 2;
      break;
    }
  }
  if (s[0] == '1') {
    int flg = 0;
    for (int i = s.length() - 1; i >= 1; i--) {
      if (s[i] == '1') {
        flg = 1;
        break;
      }
    }
    if (!flg && (s.length() % 2)) {
      ans--;
    }
  }
  printf("%d\n", ans);
  return 0;
}
