#include <iostream>
using namespace std;

int main(){
	char s[100000];
	int res1 = 0, res2 = 0;
	cin >> s;
	
	for(int i = 0; s[i] != '\0'; i++) {
		int n = ('0' + (i % 2)) ^ s[i];
		res1 += n;
		res2 += 1 - n;
	}
	
	cout << ((res1 < res2) ? res1 : res2) << endl;	
	return 0;
}