#include <bits/stdc++.h>
using namespace std;
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  unsigned long long c;
  while (a != 0) {
    c = a;
    a = b % a;
    b = c;
  }
  return b;
}
string s;
bool gr(int b, int e, int bb, int ee) {
  for (int i = 0; i < e - b && i < ee - bb; i++) {
    if (s[i + b] != s[i + bb]) {
      return (s[i + b] > s[i + bb]);
    }
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  while (cin >> s) {
    vector<pair<int, int> > ppp = {make_pair(0, 1)};
    for (int i = 1, m = 0; i < s.size(); i++) {
      if (s[i] == 48)
        ppp[m].second++;
      else {
        m++;
        ppp.push_back(make_pair(i, 1));
      }
    }
    int lsf = ppp[0].second, res = 1;
    for (int i = 1; i < ppp.size(); i++) {
      if (ppp[i].second > lsf) {
        res = 1;
      } else if (ppp[i].second == lsf) {
        if (gr(0, lsf, lsf, lsf + ppp[i].second)) {
          res++;
        } else
          res = 1;
      } else
        res++;
      lsf += ppp[i].second;
    }
    cout << res << "\n";
  }
  return 0;
}
