object Main extends App {
  val S = scala.io.StdIn.readLine()
  val list = S.toList

  val oddList: List[Char] = list.zipWithIndex.filter(tt => tt._2 % 2 == 0).unzip._1
  val evenList: List[Char] = list.zipWithIndex.filter(tt => tt._2 % 2 != 0).unzip._1

  val startWithZeroCount = oddList.count(_ == '1') + evenList.count(_ == '0')
  val startWithOneCount = oddList.count(_ == '0') + evenList.count(_ == '1')

  println(startWithZeroCount.min(startWithOneCount))
}