import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main ()
{
	string s;
	while ((s = readln.strip) != "")
	{
		int res1 = 0;
		int res2 = 0;
		foreach (i, c; s)
		{
			res1 += (c != ('0' ^ (i & 1)));
			res2 += (c != ('1' ^ (i & 1)));
		}
		writeln (min (res1, res2));
	}
}
