#include <bits/stdc++.h>
using namespace std;
bool more(string curr, string tmp) {
  if (tmp.size() > curr.size()) return true;
  if (tmp.size() == curr.size() && tmp[0] - '0' > curr[0] - '0') return true;
  return false;
}
int main() {
  string st;
  cin >> st;
  vector<string> v;
  v.push_back("yummy");
  int last = 0;
  for (int i = 0; i < st.size();) {
    string tmp = "" + st.substr(i, 1);
    i++;
    while (st[i] == '0') {
      tmp += "0";
      i++;
    }
    v.push_back(tmp);
  }
  string tmp = v[1];
  int k = 0;
  int ans = 1;
  for (k = 2; k < v.size(); k++) {
    if (more(tmp, v[k])) {
      ans = k;
    }
    tmp += v[k];
  }
  cout << v.size() - ans;
  return 0;
}
