#include <bits/stdc++.h>
using namespace std;
const long long maxx = 4e2 + 19;
string s;
int32_t main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> s;
  long long n = s.size();
  if (n % 2) {
    long long one = 0;
    for (auto i : s)
      if (i == '1') one++;
    if (one > 1)
      cout << n / 2 + 1;
    else
      cout << n / 2;
  } else
    cout << n / 2;
  return 0;
}
