#include <bits/stdc++.h>
using namespace std;
string input;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> input;
  int ans = 1;
  int it = input.size() - 1;
  int zeroes = 0;
  while (it > 0) {
    if (input[it] == '0')
      ++zeroes;
    else {
      if (it > zeroes + 1 || (it == zeroes + 1 && input[0] >= input[it]))
        ++ans, zeroes = 0;
      else
        break;
    }
    --it;
  }
  cout << ans;
  return 0;
}
