#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int a[2] = {0, 1};
  char c;
  while (cin >> c) a['1' - c] = min(a[0], a[1]) + 1;
  cout << a[0];
  return 0;
}
