#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long n = 0;
  int flag = 0;
  for (int i = s.length() - 1; i > 0; i--) {
    if (s[i] == '1' && i > 0) flag = 1;
    n++;
  }
  int ans = (n + 1) / 2;
  if (flag == 1 && n % 2 == 0) ans++;
  cout << ans << endl;
  return 0;
}
