#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const int mod = 1e9 + 7;
int a[5005], b[5005];
int main() {
  ios_base::sync_with_stdio(0);
  string s;
  cin >> s;
  int ans = 0;
  int i = s.size() - 1, j = 0, kek = 0;
  while (i >= 0) {
    j = i;
    while (s[j] == '0') j--;
    kek = i - j + 1;
    if (kek > j) {
      ans++;
      i = -1;
    } else if (kek == j) {
      ans++;
      if (s[0] >= s[j])
        i = j - 1;
      else
        i = -1;
    } else {
      ans++;
      i = j - 1;
    }
  }
  cout << ans << endl;
}
