#include <bits/stdc++.h>
using namespace std;
char s[100005];
int Count(int L, int R) {
  int x = R - 1;
  while (x > L && s[x] == '0') x--;
  if (x - L < R - x || (x - L == R - x && strncmp(s + L, s + x, x - L) < 0))
    return 1;
  return Count(L, x) + Count(x, R);
}
int main() {
  int n = strlen(gets(s));
  printf("%d\n", Count(0, n));
  return 0;
}
