#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(NULL);
  string s;
  cin >> s;
  int as = s.size() - 1, t;
  t = as / 2 + 1;
  if (as % 2 != 0)
    cout << t;
  else {
    int cnt = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '1') {
        cnt++;
        if (cnt >= 2) break;
      }
    }
    if (cnt >= 2)
      cout << t;
    else
      cout << t - 1;
  }
}
