#include<iostream>

using namespace std;

int main()
{
	int sum=0,k;
	string s;
	cin>>s;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='0'+i%2) sum++;
	}
	k=s.size()-sum;
	sum>k?sum=k:sum=sum;
	cout<<sum;
	return 0;
}