#include <bits/stdc++.h>
using namespace std;
string s;
vector<string> sep;
void solve(int r) {
  for (int i = r - 1; i >= 0; --i) {
    if (s[i] != '0') {
      sep.push_back(s.substr(i, r - i));
      solve(i);
      return;
    }
  }
}
int main() {
  cin >> s;
  solve(s.size());
  reverse(sep.begin(), sep.end());
  int n = sep.size();
  int ans = 1;
  int cur = sep[0].size();
  for (int i = 1; i < n; ++i) {
    if (cur > sep[i].size() ||
        (cur == sep[i].size() && sep[i] <= s.substr(0, cur)))
      ans++;
    else
      ans = 1;
    cur += sep[i].size();
  }
  cout << ans << '\n';
}
