#ifdef LOCAL
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstring>
#else
#include <bits/stdc++.h>
#endif
using namespace std ;

typedef long long ll ;
#define rep(i , n ) for ( int i =0; i < n ; i++)
#define _sort(arg) sort(begin(arg), end(arg))
#define MOD 1000000007
#define pb push_back
#define DEBUG(x) cout << #x << ": " << x << endl;

class UnionFind {
private:
	unsigned size_; 
	std::vector<unsigned> par, rank;
public:
	UnionFind() : size_(0), par(std::vector<unsigned>()), rank(std::vector<unsigned>()) {};
	UnionFind(unsigned size__) : size_(size__) {
		par.resize(size_); rank.resize(size_);
		for (unsigned i = 0; i < size_; i++) par[i] = i, rank[i] = 0;
	}
	unsigned size() { return size_; }
	//unsigned root(unsigned x) { return par[x] == x ? x : par[x] = root(par[x]); }
	unsigned root(unsigned x)
	{
		while(par[x] != x)
		{
			par[x] = par[par[x]];
			x = par[x];
		}
		return x;
	}
	bool same(unsigned x, unsigned y) { return root(x) == root(y); }
	void unite(unsigned x, unsigned y) {
		x = root(x), y = root(y);
		if (x == y) return;
		if (rank[x] < rank[y]) par[x] = y;
		else if (rank[x] == rank[y]) par[y] = x, rank[x]++;
		else par[y] = x;
	}
	bool operator==(const UnionFind &u) { return par == u.par; }
	bool operator!=(const UnionFind &u) { return par != u.par; }
};

/*
__attribute__((constructor))
void initial()
{
	cin.tie(NULL);
	ios::sync_with_stdio(false);
}
*/

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

	string s;
	
	cin >> s;

	/*
	int len = s.size();
	int m[2][2];
	memset(m, 0 , sizeof(m));

	rep(i, len)
	{
		if (s[i] == '0')
		{
			if (i % 2)
			{
				m[0][1]++;
			}
			else
			{
				m[0][0]++;
			}
		}
		else
		{
			if (i % 2)
			{
				m[1][1]++;
			}
			else
			{
				m[1][0]++;
			}
		}
	}
	int total_0 = m[0][0] + m[0][1];

	int total_1 = m[1][0] + m[1][1];
	
	int n = len / 2;
	int total = 0;

	if (len % 2)
	{
		if (total_0 % 2)
		{
			if (m[0][0] > m[0][1])
			{
				total = n+1 - m[0][0] + m[0][1];
			}
			else
			{
				total = n+1 - m[0][1]+ m[0][0];
			}
			
		}
		else
		{
			if (m[1][0] > m[1][1])
			{
				total = n+1 - m[1][0] + m[1][1];
			}
			else
			{
				total = n+1 - m[1][1]+ m[1][0];
			}
		}
		
	}
	else
	{
		if(total_0 > total_1)
		{
			if (m[0][0]>m[0][1])
			{
				total = n- m[0][0] + m[0][1];
			}
			else
			{
				total = n - m[0][1] + m[0][0];
			}
			
		}

		else if(total_1 > total_0)
		{
			if (m[1][0]>m[1][1])
			{
				total = n- m[1][0] + m[1][1];
			}
			else
			{
				total = n - m[1][1] + m[1][0];
			}
			
		}
		else
		{
			if (m[0][0] > m[0][1])
			{
				total = n - m[0][0] + m[0][1];
			}
			else
			{
				total = n - m[0][1] + m[0][0];
			}
			
		}
	}

	cout << total << endl;
	*/
	int total_x = 0;
	int total_y = 0;
	int len = s.size();
	char curr;

	curr = s[0];
	for(int i = 1; i < len; i++)
	{
		if (s[i] != curr)
		{
			curr = s[i];
		}
		else 
		{
			total_x++;
			curr = ((s[i] == '0') ? '1' : '0');
		}
	}
	
	curr = ((s[0] == '0') ? '1' : '0');
	total_y = 1;
	for(int i = 1; i < len; i++)
	{
		if (s[i] != curr)
		{
			curr = s[i];
		}
		else 
		{
			total_y++;
			curr = ((s[i] == '0') ? '1' : '0');
		}
	}

	cout << (total_x < total_y ? total_x : total_y) << endl;
	

	return 0;
}


Measured memory_bytes: 512