#include <bits/stdc++.h>
using namespace std;
const long long q = 239017;
const long long mod = 1e9 + 7;
const long long mod2 = 1e9 + 13;
const long long MAXN = 2e4 + 100;
const long long MAXM = 5e4 + 100;
void $main() {
  string s;
  cin >> s;
  long long n = s.size(), ct = (n + 1) / 2;
  bool fl = (s[0] == '1' && (n % 2));
  for (long long i = 1; i < n; ++i) {
    if (s[i] != '0') {
      fl = 0;
      break;
    }
  }
  if (n == 1 && s[0] == '0')
    cout << 0;
  else
    cout << ct - fl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  $main();
  return 0;
}
