#include <bits/stdc++.h>
using namespace std;
bool comp(string S, long long ind) {
  long long i = 0, j = ind;
  while (i < ind && j < S.size() && S[i] == S[j]) {
    ++i;
    ++j;
  }
  if (S[i] < S[j]) {
    return 0;
  }
  return 1;
}
int main() {
  long long i, j, n, m;
  unsigned long long ans = 1;
  string S;
  cin >> S;
  n = S.size();
  long long diff;
  i = n - 1;
  while (i >= 0) {
    diff = 1;
    while (i >= 0 && S[i] == '0') {
      --i;
      diff++;
    }
    if (i <= n / 2 - (1 - n % 2)) {
      cout << ans << "\n";
      return 0;
    }
    if (n % 2 == 0 && i == n / 2) {
      if (!comp(S, i)) {
        cout << ans << "\n";
        return 0;
      }
      ans++;
      --i;
      S.resize(S.size() - diff);
    } else {
      ans++;
      --i;
      S.resize(S.size() - diff);
    }
    n = S.size();
  }
  cout << ans << "\n";
  return 0;
}
