import java.util.Scanner
object Main extends App {
  val sc = new Scanner(System.in)
  val tiles = sc.next.map(_ - '0').zipWithIndex
  println(Math.min(
    tiles.count{case (c, i) => c == i % 2},
    tiles.count{case (c, i) => c != i % 2}
  ))
}