#include <bits/stdc++.h>
using namespace std;
string a[100010], second;
int m = 0, n;
bool first(string x, string y) {
  if (x.size() > y.size()) return 1;
  if (y.size() > x.size()) return 0;
  for (int i = 0; i < x.size(); i++)
    if (y[i] > x[i]) return 0;
  return 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> second;
  n = second.size();
  for (int i = 0; i < n; i++)
    if (second[i] == '0')
      a[m - 1] += "0";
    else
      a[m++] = second[i];
  second = a[0];
  int res = 1;
  for (int i = 1; i < m; i++)
    if (!first(second, a[i])) {
      second += a[i];
      res = 1;
    } else {
      second += a[i];
      res++;
    }
  cout << res;
  return 0;
}
