fun main(args: Array<String>) {
	val s = readLine() ?: return
	var count1 = 0
	var count2 = 0
	for (i in s.indices) {
		val cor = if (i % 2 == 0) '0' else '1'
		if (s[i] == cor) count1++
		else count2++
	}
	if (count1 <= count2) println(count1)
	else println(count2)
}