#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  long long int cnt1 = 0, l = s.length(), i;
  for (i = 0; i < l; i++)
    if (s[i] == '1') cnt1++;
  if (l == 1 && s[0] == '0') {
    cout << 0;
    return;
  }
  if (cnt1 == 1)
    cout << (l) / 2;
  else
    cout << (l + 1) / 2;
}
int main() {
  long long int t = 1;
  while (t--) solve();
  return 0;
}
