#include <bits/stdc++.h>
using namespace std;
struct edje {
  int from, to;
  long long w;
  edje(int from, int to, long long w) : from(from), to(to), w(w) {}
  bool operator<(const edje& e) const { return w < e.w; }
};
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
const long long oo = (long long)((1e18) + 1);
const double eps = 1e-9;
const long long mod7 = 1000000007;
long long mod(long long a, long long b) { return (a % b + b) % b; }
long long strTonumModa(string s, long long athemod) {
  long long ans = 0;
  for (long long i = 0; i < ((long long)s.size()); i++) {
    ans = (ans * 10 + s[i] - '0') % athemod;
  }
  return ans;
}
long long mod_exp(long long base, long long p, long long MOD) {
  if (p == 0) return 1;
  if (p == 1) return base;
  long long ret = mod_exp(base, p / 2, MOD) % MOD;
  ret = (ret * ret) % MOD;
  if (p % 2 == 1) ret = (ret * base) % MOD;
  return ret;
}
string getstr(long long x) {
  stringstream ss;
  ss << x;
  string str = ss.str();
  return str;
}
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> s;
  int zeros = 0, curzeros = 0;
  int ans = 0;
  for (int i = ((long long)s.size()) - 1; i >= 0; i--) {
    if (zeros == 0 && s[i] != '0') {
      if (i == 1 && s[i] > s[0]) {
        ans++;
        break;
      }
      ans++;
    } else {
      zeros = 1;
      if (s[i] == '0') {
        curzeros++;
        continue;
      }
      if (curzeros + 1 < i) {
        ans++;
        curzeros = 0;
        zeros = 0;
        continue;
      } else if (curzeros + 1 > i) {
        ans++;
        break;
      } else {
        if (s[i] <= s[0]) {
          ans += 1;
          curzeros = 0;
          zeros = 0;
          continue;
        }
        ans += 1;
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
