#include <bits/stdc++.h>
using namespace std;
const int MAXN = 10001;
int get(int r, vector<int> &t) {
  int res = 0;
  for (; r >= 0; r = (r & (r + 1)) - 1) {
    res += t[r];
  }
  return res;
}
void upd(int r, int d, vector<int> &t) {
  for (; r < (int)t.size(); r = (r | (r + 1))) {
    t[r] += d;
  }
}
int solve() {
  freopen("input.txt", "r", stdin);
  vector<int> t(100000, 0);
  int n;
  scanf("%d", &n);
  while (n--) {
    int q, p;
    scanf("%d %d", &q, &p);
    if (q == 1) {
      printf("%d\n", get(100000 - p, t));
      upd(100000 - p, 1, t);
    } else {
      int i = 0;
      while (i < 100000 && get(i, t) != p + 1) i++;
      upd(i, -1, t);
    }
  }
  return 0;
}
bool cmp(string a, string b) {
  if (a.size() < b.size()) return true;
  if (a.size() > b.size()) return false;
  int i = 0;
  int n = a.size();
  while (i < n && a[i] == b[i]) i++;
  if (i == n) return false;
  return a[i] < b[i];
}
int main() {
  string s;
  cin >> s;
  s += '=';
  vector<string> a;
  int n = s.size() - 1;
  string t = "";
  for (int i = 0; i < n; ++i) {
    t += s[i];
    if (s[i + 1] != '0') {
      a.push_back(t);
      t = "";
    }
  }
  s = s.substr(0, n);
  int m = a.size();
  t = s.substr(0, n - a[m - 1].size());
  int i = m - 1;
  while (i > 0 && !cmp(t, a[i])) {
    i--;
    t = t.substr(0, t.size() - a[i].size());
  }
  cout << a.size() - i;
}
