#include<iostream>
#include<string>
#include<algorithm>
#include<string.h>
#include<utility>
#include<vector>
using namespace std;

#define pb push_back
#define mp make_pair
#define ld long double
#define int long long int
#define f(i,g,n) for(int i=g;i<=n;i++)
#define rf(i,g,n) for(int i=n;i>=g;i--)

const int N=4e5;
// ll A[N];

int32_t main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);

	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif

	string S;
	cin>>S;
	int count=0;
	for(int i=1;i<S.size();i++)
	{
		if(S[i] == S[i-1])
		{
			count++;
			S[i] = char((S[i-1]-'0'+1)%2+'0');
			// cout<<i<<" "<<S<<"\n";
		}
	}
	cout<<count<<"\n";
	
	return 0;
}