import java.util.Scanner

object Main extends App  {
  val sc = new Scanner(System.in)
  val iS = sc.next

  val s = iS.split("(?<=.)").map(_.toInt)
  val n = s.length

  val count01 = s.zipWithIndex.foldLeft(0){case (count, (c,i)) =>
      if(c == i % 2) count + 1 else count
  }

  val res = Math.min(count01, n - count01)

  println(res)



}
