import scala.math._

object Main {
  def main(args: Array[String]): Unit = {
    val lines = io.Source.stdin.getLines().toSeq
    println(solve(lines))
  }

  def solve(lines: Seq[String]): String = {
    val (_even, _odd) = lines.head.split("").filter(_.length > 0).map(_.toInt).zipWithIndex.partition(_._2 % 2 == 0)
    val even = _even.map(_._1)
    val odd = _odd.map(_._1)

    val evenBlackCount = even.count(_ == 0)
    val evenWhiteCount = even.count(_ == 1)
    val oddBlackCount = odd.count(_ == 0)
    val oddWhiteCount = odd.count(_ == 1)

    min(evenBlackCount + oddWhiteCount, evenWhiteCount + oddBlackCount).toString
  }
}
