#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100100;
pair<int, int> v[MAXN];
int main() {
  string s;
  cin >> s;
  s += '1';
  int cnt = 1, p = 0, last = -1;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != '0') v[p] = {last, cnt}, p++, cnt = 0, last = s[i] - '0';
    cnt++;
  }
  p -= 1;
  int r = 0;
  pair<int, int> at = {-1, -1};
  for (int i = 1; i <= p; i++) {
    if (i == 1) {
      at = v[i];
      r = 1;
      continue;
    }
    if (v[i].second > at.second ||
        (v[i].second == at.second && v[i].first > at.first)) {
      r = 1;
      at.second += v[i].second;
      continue;
    }
    at.second += v[i].second;
    r++;
  }
  cout << r << endl;
}
