object Main extends App {

  val s = io.StdIn.readLine

  var diff1 = 0
  var diff2 = 0

  for (i <- 0 until s.size) {
    val p1 = if (i % 2 == 0) '0' else '1'
    val p2 = if (i % 2 == 0) '1' else '0'

    // println(s"$p1 $p2 ${s(i)}")

    if (s(i) != p1)
      diff1 += 1

    if (s(i) != p2)
      diff2 += 1
  }

  println(math.min(diff1,diff2))

}