import scala.io.StdIn._

object Main extends App {

  val s = readLine()

  def solve() = {
    var diffPat1 = 0
    var diffPat2 = 0
    (0 until s.length) foreach { i =>
      if(i % 2 == 0) {
        if(s(i) == '0') diffPat1 += 1
        else diffPat2 += 1
      } else {
        if(s(i) == '0') diffPat2 += 1
        else diffPat1 += 1
      }
    }
    Math.min(diffPat1, diffPat2)
  }

  println(solve())

}

