#include<iostream>
#include<string>
#include <cstdlib>
using namespace std;

int main(){
  string s;
  cin >> s;
  int diff = 0;
  for ( int i = 0; i < s.length(); i++){
    if ( i % 2 == s[i] - '0') diff++;
  }

  cout << min(diff, (int)(s.length() - diff) ) << endl;

  return 0;
}