#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double e = exp(1.0);
const double eps = 1e-8;
const int maxlen = 100005;
char str[maxlen];
bool compare(int x1, int y1, int x2, int y2);
int main() {
  ios::sync_with_stdio(false);
  while (~scanf("%s", str)) {
    int len = strlen(str);
    int ans = 0, end1 = len - 2, end2 = len - 1;
    while (end2 >= 0) {
      while (end1 >= 0 &&
             (str[end1 + 1] == '0' || !compare(0, end1, end1 + 1, end2)))
        end1--;
      if (end1 == -1) break;
      ans++;
      end2 = end1;
      end1--;
    }
    ans++;
    printf("%d\n", ans);
  }
  return 0;
}
bool compare(int x1, int y1, int x2, int y2) {
  int len1 = y1 - x1 + 1;
  int len2 = y2 - x2 + 1;
  if (len1 > len2) return 1;
  if (len2 > len1) return 0;
  for (int i = 0; i < len1; ++i) {
    if (str[x1 + i] > str[x2 + i])
      return 1;
    else if (str[x1 + i] < str[x2 + i])
      return 0;
  }
  return 1;
}
