#include <bits/stdc++.h>
using namespace std;
long long t;
char str[1000005];
int main() {
  long long a, b, c = 0, i, j;
  cin >> str;
  a = strlen(str);
  for (i = 1; i < a; i++)
    if (str[i] == '1') c = 1;
  a--;
  b = a / 2;
  if (a % 2 != 0)
    b++;
  else if (c == 1)
    b++;
  cout << b << endl;
}
