#include <bits/stdc++.h>
using namespace std;
const int mx = 1e5 + 10;
int a[mx], ans = 0;
long long sum;
string s;
int main() {
  cin >> s;
  int p = 0;
  int len = s.size();
  for (int i = 1; i < len; i++) {
    if (s[i] == '1') p = 1;
  }
  if (p == 1 || len % 2 == 0)
    cout << (len - 1) / 2 + 1 << endl;
  else
    cout << (len - 1) / 2 << endl;
  return 0;
}
