#include <bits/stdc++.h>
using namespace std;
long long sol = 0, r, i, j;
string str;
int main() {
  cin >> str;
  r = (long long)str.length() - 1;
  for (i = (long long)str.length() - 1; i >= 0; i--) {
    if (str[i] == '0') continue;
    if (r - i + 1 < i) {
      sol++;
      r = i - 1;
    } else if (r - i + 1 == i) {
      sol++;
      r = i - 1;
      for (j = 0; j < i; j++) {
        if (str[j] < str[i + j]) {
          cout << sol;
          return 0;
        }
      }
    } else {
      cout << sol + 1;
      return 0;
    }
  }
}
