object Main extends App {
	val s = scala.io.StdIn.readLine.toList.map(_.toInt - 48)

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

	for(i<-0 until s.size by 2){
		s(i) match {
			case 0 => b += 1 
			case 1 => a += 1
			case _ =>
		}
	}

	for(i<-1 until s.size by 2){
		s(i) match {
			case 0 => a += 1
			case 1 => b += 1
			case _ => 
		}
	}

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