#include <bits/stdc++.h>
using namespace std;
multiset<int> S;
char ch[1000100];
int main() {
  int prev, i, j, ans, n;
  ios_base::sync_with_stdio(false);
  cin >> ch;
  n = strlen(ch);
  prev = n;
  ans = 0;
  for (i = n - 1; i >= 0; i--) {
    if (ch[i] == '0')
      continue;
    else {
      if (prev - i == i) {
        if (ch[2 * i - prev] >= ch[i]) {
          ans++;
          prev = i;
        } else {
          ans++;
          break;
        }
      } else if (prev - i > i) {
        ans++;
        break;
      } else {
        ans++;
        prev = i;
      }
    }
  }
  cout << ans << endl;
  ;
}
