#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const int M = 1e9 + 7;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  int o = 0;
  if (s == "0") return cout << 0, 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '1') o++;
  }
  int k = int(s.size()) - 1;
  int ans = k / 2;
  if (o != 1 || k & 1) ans++;
  cout << ans;
}
