#include <bits/stdc++.h>
const int MAXN = 100100;
char s[MAXN];
int main() {
  scanf("%s", s);
  int len = strlen(s), flag = 0;
  for (int i = 1; i < len; ++i)
    if (s[i] == '1') flag = 1;
  printf("%d\n", (len + flag) >> 1);
  return 0;
}
