#include <bits/stdc++.h>
using namespace std;
mt19937_64 mt(time(0));
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(10);
  cout << fixed;
  string s;
  cin >> s;
  int i = 1, zero = 0, ret = 0;
  int mi[2] = {INT_MAX, INT_MAX};
  for (char c : s) {
    if (c == '0') {
      zero++;
      continue;
    }
    int prev = ret;
    ret++;
    if (i != 1) {
      mi[0] += zero;
      mi[1]++;
      ret = min(ret, mi[0]);
      ret = min(ret, mi[1]);
    }
    mi[0] = min(mi[0], prev + 2);
    mi[1] = min(mi[1], prev + 1);
    i++;
    zero = 0;
  }
  cout << ret << '\n';
  return 0;
}
