import scala.io.{StdIn => in}
import java.lang.{Character => char}

object Main extends App {
  val s = in.readLine.map(char.getNumericValue)

  val (res0, res1, _) = s./:(0,0,0) { case ((acc0, acc1, i), c) => 
    if(c == i) (acc0, acc1+1, i^1) else (acc0+1, acc1, i^1)
  }

  val ans = res0 min res1
  println(ans)
}