#include <bits/stdc++.h>
using namespace std;
pair<int, int> zero[100001];
int main() {
  string p;
  cin >> p;
  int len = p.length();
  int maxlenzero = 0;
  int maxzeroin = -1;
  int tmp = 0;
  int ttmp = 0;
  int zeronum = 0;
  for (int i = 0; i < len; i++) {
    if (p[i] == '0') {
      zero[zeronum].first++;
      tmp++;
      if (maxlenzero <= tmp) {
        if (maxlenzero == tmp) {
          if (p[maxzeroin] < p[ttmp]) maxzeroin = ttmp;
        } else {
          maxzeroin = ttmp;
          maxlenzero = tmp;
        }
      }
    } else {
      if (zero[zeronum].first > 0) zeronum++;
      ttmp = i;
      tmp = 0;
      zero[zeronum].second = ttmp;
    }
  }
  if (zero[zeronum].first > 0) zeronum++;
  if (len == 1) {
    printf("1\n");
    return 0;
  }
  if (maxzeroin < 0) {
    if (p[0] >= p[1]) {
      printf("%d\n", len);
    } else {
      printf("%d\n", len - 1);
    }
  } else {
    int ans = 0;
    int st = 0;
    for (int i = 0; i < zeronum; i++) {
      if (zero[i].first + 1 >= zero[i].second) {
        if (zero[i].first + 1 == zero[i].second) {
          if (p[zero[i].second] > p[0]) {
            st = zero[i].second + 1;
          }
        } else
          st = zero[i].second + 1;
      }
    }
    if (st == 0) {
      if (p[st] >= p[st + 1]) {
        ans = 0;
      } else {
        ans = -1;
      }
    }
    for (int i = st; i < len;) {
      ans++;
      i++;
      while (p[i] == '0') i++;
    }
    printf("%d\n", ans);
  }
  return 0;
}
