#include <iostream>
using namespace std;

int main() {
	string s;
	cin >> s;
	char op1[2] = {'0','1'};
	char op2[2] = {'1','0'};
	int ans1=0,ans2=0;
	for(int i=0;i<s.size();i++){
		ans1 += s[i] != op1[i&1];
		ans2 += s[i] != op2[i&1];
	}
	cout << min(ans1,ans2) << '\n';
	return 0;
}