#include <bits/stdc++.h>
int main() {
  char str[100005];
  scanf("%s", str);
  int i = strlen(str) - 1, j, k, cnt = 0, terminate;
  while (i >= 0) {
    j = i;
    while (str[j] == '0') j--;
    terminate = 0;
    if (j > i - j + 1)
      ;
    else if (j == i - j + 1) {
      for (k = j; k <= i; k++) {
        if (str[k - j] > str[k])
          break;
        else if (str[k] > str[k - j]) {
          terminate = 1;
          break;
        }
      }
    } else {
      terminate = 1;
    }
    cnt++;
    if (terminate) break;
    i = j - 1;
  }
  printf("%d\n", cnt);
}
