#include <bits/stdc++.h>
using namespace std;
string s;
int n, ans = 0;
int main() {
  cin >> s;
  s = "0" + s;
  n = s.size();
  for (int i = n - 1; i >= 0;) {
    if (s[i] == '0') {
      i--;
      continue;
    }
    int j = i, ted = 0;
    for (; j >= 0 && s[j] == s[i]; j--, ted++) {
    }
    if (ted == 1) {
    } else {
      ans++;
      for (int k = i; k > j; k--) s[k] = '0';
      s[j] = '1';
    }
    i = j;
  }
  for (int i = 0; i < n; i++)
    if (s[i] == '1') ans++;
  cout << ans << endl;
  return 0;
}
