#include <bits/stdc++.h>
using namespace std;

int main() {
  string S;
  cin >> S;
  int N = 0;
  int s = S.size();
  for (int i = 0; i < s; i++) {
    if (i % 2 == 0 && S[i] == '0') N += 1;
    if (i % 2 == 1 && S[i] == '1') N += 1;
  }
  
  cout << min(N, s-N) << endl;
}