#include <bits/stdc++.h>
using namespace std;
string s;
int c, j, k, l;
int main() {
  cin >> s;
  j = s.size() - 1;
  while (j >= 0) {
    k = j;
    while (s[k] == '0') k--;
    l = j - k + 1;
    if (l > k) {
      c++, j = -1;
    } else if (l == k) {
      c++;
      if (s[0] >= s[k])
        j = k - 1;
      else
        j = -1;
    } else {
      c++;
      j = k - 1;
    }
  }
  cout << c << endl;
  return 0;
}
