#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  int n = s.size(), j = n - 1, ans = 0;
  while (j >= 0) {
    int k = j;
    while (s[k] == '0') {
      k--;
    }
    int len = j - k + 1;
    if (len > k) {
      ans++;
      j = -1;
      continue;
    }
    if (len == k) {
      if (s[0] >= s[k])
        j = k - 1;
      else
        j = -1;
      ans++;
      continue;
    }
    if (len < k) {
      ans++;
      j = k - 1;
    }
  }
  cout << ans << endl;
  return 0;
}
