#include <bits/stdc++.h>
int main() {
  int i, j, k, l, imax, cnt;
  static char p[100002];
  scanf("%s", p);
  l = strlen(p);
  cnt = 0;
  i = j = 0;
  k = INT_MAX;
  imax = 1;
  while (i < l) {
    j = i + 1;
    while (j < l && p[j] == '0') j++;
    cnt++;
    if (k < j - i || (k == j - i && p[0] < p[i])) imax = cnt;
    i = k = j;
  }
  printf("%d\n", cnt - imax + 1);
  return 0;
}
