#include <bits/stdc++.h>
using namespace std;
struct classcomp {
  bool operator()(const int& lhs, const int& rhs) const { return lhs < rhs; }
};
int main() {
  string ss;
  cin >> ss;
  string s;
  for (int i = 0; i < ss.size(); i++) s += ss[ss.size() - 1 - i];
  s += '0';
  int n = s.size();
  int res = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '0') continue;
    int j = i + 1;
    while (j < s.size() && s[j] == '1') j++;
    if (j < i + 2) {
      res++;
      continue;
    }
    res++;
    s[j] = '1';
    i = j - 1;
  }
  cout << res << endl;
  return 0;
}
