#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 100;
const int mod = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  int k = s.size();
  int flag = 0;
  for (int i = 1; i < s.size(); i++) {
    if (s[i] == '1') {
      flag = 1;
      break;
    }
  }
  int ans = (k + 1) / 2;
  if (!flag && k % 2 != 0) ans--;
  cout << ans << endl;
  return 0;
}
