#include <bits/stdc++.h>
char s[1000008], now[1000008], temp[1000008];
int i, j, len, ans, ls;
int main() {
  while (scanf("%s", s) > 0) {
    ls = strlen(s);
    now[0] = s[0];
    for (i = 1; s[i] == '0'; i++) now[i] = s[i];
    now[len = i] = '\0';
    for (ans = 1; i < ls;) {
      temp[j = 0] = s[i++];
      for (j++; i < ls && s[i] == '0'; j++, i++) temp[j] = s[i];
      temp[j] = '\0';
      if (len > j)
        ans++;
      else if (len == j && strcmp(now, temp) >= 0)
        ans++;
      else
        ans = 1;
      len = len + j;
      strcat(now, temp);
    }
    printf("%d\n", ans);
  }
  return 0;
}
