#include <bits/stdc++.h>
using namespace std;
int main() {
  int a = 0, b = 1;
  string s;
  cin >> s;
  for (int i = 0; i <= s.size(); i++) {
    if (s[i] == '1')
      a = min(a, b) + 1;
    else
      b = min(a, b) + 1;
  }
  cout << min(a, b) << endl;
}
