#include <bits/stdc++.h>
using namespace std;
template <typename T, typename T1>
T amax(T& a, T1 b) {
  if (b > a) a = b;
  return a;
}
template <typename T, typename T1>
T amin(T& a, T1 b) {
  if (b < a) a = b;
  return a;
}
const long long N = 200005, INF = 2000000000000000000;
void solve() {
  string s;
  cin >> s;
  long long i = 0;
  long long ans = 0;
  long long f = 0, l = 0;
  f = s.find_first_of('1');
  l = s.find_last_of('1');
  if (f == l) {
    if (s.length() & 1) {
      cout << (s.length() - 1) / 2;
      return;
    }
    cout << (s.length()) / 2;
  } else {
    cout << (s.length() + 1) / 2;
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
}
