#include <iostream>
#include <string>
using namespace std;
int main()
{
	int n, jud, a=0, b=0;
	string s;
	cin>>s;
	n=s.length();
	for(int i=0;i<n;i++)
	{
		jud=i%2;
		if(jud!=s[i]-48)a++;
		else b++;
	}
	if(a<b)
	{
		cout<<a<<endl;
	}
	else
	{
		cout<<b<<endl;
	}
	
	return 0;
}