#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  while (cin >> a) {
    vector<int> ko;
    int i, sum = 0, len = a.size(), po, j;
    for (i = 0; i < a.size(); i++) {
      sum++;
      if (a[i] != '0' && (i == len - 1 || a[i + 1] != '0')) {
        ko.push_back(1);
        sum = 0;
      }
      if (a[i] == '0' && (i == len - 1 || a[i + 1] != '0')) {
        ko.push_back(sum);
        sum = 0;
      }
    }
    sum = 1;
    po = 0;
    for (i = ko.size() - 1; i >= 0; i--) {
      po += ko[i];
      if (len - po > ko[i]) {
        sum++;
      }
      if (len - po == ko[i]) {
        string b, c;
        for (j = 0; j < len - po; j++) b += a[j];
        for (j = len - po; j < 2 * (len - po); j++) c += a[j];
        if (b >= c)
          sum++;
        else
          break;
      }
      if (len - po < ko[i]) break;
    }
    cout << sum << endl;
  }
}
