#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
const double EPS = 1e-9;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
bool cmp(string left, string right) {
  if (left.length() != right.length()) {
    return left.size() < right.size();
  }
  int n = left.size();
  for (int i = 0; i < n; i++) {
    if (left[i] != right[i]) {
      return left[i] < right[i];
    }
  }
  return false;
}
int main() {
  string str;
  cin >> str;
  int cp = 0;
  int ans = 1;
  for (int i = str.length() - 1; i >= 0; i--) {
    int c = cp + 1;
    while (0 <= i && str[i] == '0') {
      i--;
      c++;
    }
    string ss = str.substr(i, c);
    str = str.substr(0, i);
    if (ss.length() == 0 || str.length() == 0) break;
    if (cmp(str, ss)) {
      str += ss;
      cp = c;
    } else {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
