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

  val n = s.length
  val matchcase1 = ("01"*((n/2.0).ceil.toInt)).take(n)
  val matchcase2 = ("10"*((n/2.0).ceil.toInt)).take(n)

  val count1 = (s zip matchcase1).count(t => t._1 != t._2)
  val count2 = (s zip matchcase2).count(t => t._1 != t._2)

  println(math.min(count1, count2))
}