#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline int popcount(T t) {
  if (std::numeric_limits<T>::digits <=
      std::numeric_limits<unsigned int>::digits) {
    return __builtin_popcount(t);
  } else {
    return __builtin_popcountll(t);
  }
}
const long double EPS = 1e-8;
const long double PI = acosl(0.0) * 2;
void solve() {
  string s;
  getline(cin, s);
  reverse((s).begin(), (s).end());
  int ans = 0;
  int l = 0;
  int n = s.length();
  while (l < n) {
    int r = l;
    while (s[r] == '0') ++r;
    ++ans;
    if (r - l + 1 > n - r - 1 || (r - l + 1 == n - r - 1 && s[r] > s[n - 1])) {
      break;
    }
    l = r + 1;
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  solve();
  return 0;
}
