#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const double PI = 3.14159265359;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  vector<int> dp = {0, 1};
  for (int i = 0; i < n; i++) {
    dp['1' - s[i]] = min(dp[0], dp[1]) + 1;
  }
  cout << dp[0];
  return 0;
}
