#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  getline(cin, s, char(10));
  int ans = 0;
  int n = s.length();
  int j = 0;
  vector<int> z(n, 0);
  for (int i = 1, l = 0, r = 0; i < n; ++i) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
  j = 0;
  for (int i = 0; i < n; i++) {
    j = i;
    if (s[i] != '0') {
      while ((j < n) && (s[j + 1] == '0')) j++;
      if (j - i + 1 < i)
        ans++;
      else {
        if (j - i + 1 > i)
          ans = 1;
        else {
          if ((z[i] >= i) || (s[z[i]] > s[i + z[i]]))
            ans++;
          else
            ans = 1;
        }
      }
      i = j;
    }
  }
  cout << ans;
  return 0;
}
