#include <bits/stdc++.h>
using namespace std;
int a, r, n, k = 1;
string s;
int main() {
  cin >> s;
  n = s.length(), r = n - 1;
  for (int i = n - 1; i >= 0; --i) {
    a = (i - 1) - (r - i);
    if (s[i] == '0') continue;
    if (a >= 0 && (a > 0 || s[i] <= s[a])) k++, r = i - 1;
  }
  cout << k;
}
