#include <bits/stdc++.h>
using namespace std;
const int maxn = 300000;
const long long INF = 1e18;
const int sqrtConst = 550;
const int alphabet = 26;
const long long mod = 998244353;
void solve() {
  string s;
  cin >> s;
  bool has1 = false;
  for (int i = 1; i < s.size(); i++) {
    if (s[i] == '1') {
      has1 = true;
      break;
    }
  }
  int cnt = (s.size() + 1) / 2;
  if (!has1 && (s.size() % 2)) cnt--;
  cout << cnt;
}
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  cout << setprecision(6) << fixed;
  solve();
  return 0;
}
