#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  int cnt = 0;
  for (int i = 0; i < s.size(); ++i) cnt += s[i] == '1';
  if (s.size() % 2) {
    if (cnt > 1)
      cout << (s.size()) / 2 + 1 << "\n";
    else
      cout << (s.size()) / 2 << "\n";
  } else {
    cout << s.size() / 2 << "\n";
  }
  return 0;
}
