#include <bits/stdc++.h>
using namespace std;
int n, len;
int a[101100], head[101100];
char s[101100];
int main(void) {
  while (~scanf("%s", s)) {
    len = strlen(s);
    n = 0;
    for (int i = 0; i < (len); i++) {
      if (s[i] == '0') {
        a[n]++;
      } else {
        n++;
        a[n] = 1;
        head[n] = s[i] - '0';
      }
    }
    int ans = 1;
    int last = a[1], lasthead = head[1];
    for (int i = (2); i <= (n); i++) {
      if ((a[i] > last) || (a[i] == last && lasthead < head[i])) {
        ans = 1;
      } else {
        ans++;
      }
      last += a[i];
    }
    printf("%d\n", ans);
  }
  return 0;
}
