
object Main extends App {
	val s = scala.io.StdIn.readLine

	var a = 0 // 01
	var b = 0 // 10
	var c = '0'

	for(i<-0 until s.size){
		if(s(i) == c) b += 1
		else if(s(i) != c) a += 1

		if(c == '0') c = '1'
		else c = '0'
	}


	println(math.min(a, b))
}
