#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
char s[N];
int main() {
  scanf("%s", s);
  int n = strlen(s);
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  int ans = 0;
  int i = 0;
  while (i < n) {
    if (i == 0) {
      if (s[1] == '0') {
        i++;
        while (s[i] == '0') i++;
        ans++;
        continue;
      } else {
        ans++;
        i++;
        continue;
      }
    }
    if (s[i + 1] == '0') {
      int j = i + 1;
      while (s[j] == '0') j++;
      if (j - i > i) {
        ans = 1;
        i = j;
        continue;
      }
      if (j - i < i) {
        ans++;
        i = j;
        continue;
      }
      if (s[0] >= s[i]) {
        ans++;
        i = j;
        continue;
      }
      ans = 1;
      i = j;
    } else {
      if (i > 1) {
        i++;
        ans++;
        continue;
      }
      if (s[0] >= s[i]) {
        ans++;
        i++;
        continue;
      } else {
        i++;
        ans = 1;
        while (i < n && s[i] == '0') i++;
        continue;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
