#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  int l = s.size();
  for (int i = l - 1; i > 0; i--) {
    if (s[i] == '1') {
      l++;
      break;
    }
  }
  cout << l / 2 << endl;
}
