import java.util.Scanner

import scala.annotation.tailrec

object Main {
  def main(args: Array[String]) = {
    val sc = new Scanner(System.in)
    val S = sc.nextLine()

    val odd = 0.until(S.length).map(i => if (i%2 == 1)"1" else "0")
    val even = 0.until(S.length).map(i => if (i%2 == 1)"0" else "1")

    val o = S.zip(odd).map{
      case (c, s) => if (c.toString == s) false else true
    }.count(_ == true)
    val e = S.zip(even).map{
      case (c, s) => if (c.toString == s) false else true
    }.count(_ == true)

    println(o.min(e))
  }
}
