#include <bits/stdc++.h>
using namespace std;
string p, tmp;
vector<string> b;
int main() {
  cin >> p;
  int n = p.length();
  int cnt = 0, ind = -1;
  for (int i = 0; i < n; i++) {
    if (p[i] != '0') {
      if (ind >= 0) tmp.clear();
      tmp += p[i];
      b.push_back(tmp);
      ind++;
    } else {
      b[ind] += p[i];
    }
  }
  int ans = 1;
  tmp.clear();
  for (int i = 0; i < b.size() - 1; i++) {
    tmp += b[i];
    if (tmp.length() < b[i + 1].length()) {
      ans = 1;
      continue;
    } else if (tmp.length() == b[i + 1].length()) {
      if (tmp[0] >= b[i + 1][0]) {
        ans++;
      } else
        ans = 1;
    } else
      ans++;
  }
  cout << ans;
  return 0;
}
