#include <bits/stdc++.h>
using namespace std;
char str[100010];
bool judge(int l, int r) {
  int la = l, lb = r - l;
  if (la > lb) return true;
  if (la < lb) return false;
  for (int i = 0; i < la; ++i) {
    if (str[i] > str[i + l]) return true;
    if (str[i] < str[i + l]) return false;
  }
  return true;
}
int main() {
  while (gets(str)) {
    int len = strlen(str);
    int pos = len - 1;
    int ans = 0;
    while (pos >= 0) {
      if (str[pos] != '0') {
        if (judge(pos, len)) {
          ans++;
          len = pos;
        }
      }
      pos--;
    }
    printf("%d\n", ans + 1);
  }
}
