#include <bits/stdc++.h>

using namespace std;

int main() {
	string s;
	cin >> s;
	int r = 0;
	for (int i = s.length(); i--;)
		r += (i^s[i]) & 1;
	cout << min(r, (int)s.length() - r) << endl;
	return 0;
}
