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

int main() {
	string S; cin >> S;
	int bf=0, wf=0;
	for(int i=0; i<S.size(); ++i){
	    if(S[i]=='0' ^ i%2==0) ++wf;
	    else ++bf;
	}
	cout << min(wf, bf) << endl;
	return 0;
}
