#include <bits/stdc++.h>
using namespace std;
char s[1000009];
int comp(string a, string b) {
  if (a.size() < b.size()) return -1;
  if (a.size() > b.size()) return 1;
  for (int i = 0; i < a.size(); ++i)
    if (a[i] > b[i])
      return 1;
    else if (a[i] < b[i])
      return -1;
  return 0;
}
void rev(string &s) {
  int i = 0;
  while (i * 2 < s.size()) swap(s[i], s[s.size() - i - 1]);
}
int main() {
  while (scanf("%s", s) > 0) {
    int n = strlen(s);
    int flag = 0, idx = 0;
    for (int i = 0; i < n; ++i) {
      if (s[i + 1] == '0') {
        int j = i + 1;
        while (j < n && s[j] == '0') ++j;
        if (j - i > i) {
          flag = 1;
          idx = j;
        }
        if (j - i == i && s[i] > s[0]) {
          flag = 1;
          idx = j;
        }
        i = j - 1;
      }
    }
    int start = idx;
    if (!flag && s[0] < s[1])
      start = 2;
    else if (!flag)
      start = 0;
    int ans = start ? 1 : 0;
    for (int i = start; i < n; ++i) {
      ans += s[i] > '0' && s[i] <= '9';
      int j = i + 1;
      while (j < n && s[j] == '0') ++j;
    }
    printf("%d\n", ans);
  }
  return 0;
}
