#include <bits/stdc++.h>
using namespace std;
vector<string> arr;
int main() {
  string s;
  cin >> s;
  string t = "";
  t += s[0];
  for (int i = 1; i < s.size(); i++) {
    if (s[i] == '0')
      t += s[i];
    else {
      arr.push_back(t);
      t = s[i];
    }
  }
  arr.push_back(t);
  int k = 1;
  string res = arr[0];
  for (int i = 1; i < arr.size(); i++) {
    if (res.size() > arr[i].size()) {
      k++;
    } else if (res.size() < arr[i].size()) {
      k = 1;
    } else if (res >= arr[i]) {
      k++;
    } else
      k = 1;
    res += arr[i];
  }
  cout << k << endl;
  return 0;
}
