#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e+9;
string second, a[100005], first, mx;
bool comp(string a, string b) {
  int n, m;
  n = a.size();
  m = b.size();
  if (n > m) return 1;
  if (n < m) return 0;
  for (int i = 0; i < n; i++)
    if (a[i] < b[i])
      return 0;
    else if (a[i] > b[i])
      return 1;
    else
      continue;
  return 1;
}
int main() {
  int n, size = 0, x;
  cin >> second;
  n = second.size();
  a[size] += second[0];
  for (int i = 1; i < n; i++) {
    if (second[i] != '0') {
      size++;
      if (size == 1) first = a[0];
      if (size == 2) {
        mx = a[1];
        x = 1;
      }
      if (size > 2) {
        if (comp(a[size - 1], mx)) {
          mx = a[size - 1];
          x = size - 1;
        }
      }
    }
    a[size] += second[i];
  }
  size++;
  if (size == 2) {
    mx = a[1];
    x = 1;
  }
  if (size > 2) {
    if (comp(a[size - 1], mx)) {
      mx = a[size - 1];
      x = size - 1;
    }
  }
  int j;
  while (true) {
    first = a[0];
    j = 1;
    while (!comp(first, mx) && j <= x) first += a[j++];
    if (j == x + 1 || j == 1) break;
    mx = a[1];
    x = 1;
    for (int i = 2; i < j; i++)
      if (comp(a[i], mx)) {
        mx = a[i];
        x = i;
      }
  }
  cout << size - j + 1;
  return 0;
}
