#include <bits/stdc++.h>
using namespace std;
struct pairvar {
  int a;
  int b;
  int c;
  int max;
};
bool isPrime(long long x) {
  if (x == 1) {
    return false;
  }
  long long a = (long long)x;
  for (int i = 2; i <= (long long)sqrt((double)a); i++) {
    if (a % i == 0) {
      return false;
    }
  }
  return true;
}
int gcd(int a, int b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
long long factorial(long long x) {
  long long sum = 1;
  for (long long i = 1; i <= x; i++) {
    sum *= i;
  }
  return sum;
}
string tostr(int x) {
  string s = "";
  while (x != 0) {
    s += (x % 10) + '0';
    x /= 10;
  }
  string t = "";
  for (int i = s.length() - 1; i >= 0; i--) {
    t += s[i];
  }
  return t;
}
bool cmp(const pairvar &a, const pairvar &b) {
  if (a.a == b.a) return a.b < b.b;
  return a.a < b.a;
}
int calc(int a, int b) { return (a * b) / gcd(a, b); }
int main() {
  string s;
  cin >> s;
  int ans = 1;
  int k = s.size() - 1;
  int j = 1;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == '0') {
      k--;
      j++;
    } else {
      if (k > j) {
        ans++;
        k--;
        j = 1;
      } else if (k == j) {
        if (s[0] >= s[i]) {
          j = 1;
          k--;
          ans++;
        } else {
          j++;
          k--;
        }
      }
    }
  }
  cout << ans;
}
