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

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

  val res0 = s./:(0,0) { case ((acc, i), c) => 
    if(c == i) (acc, i^1) else (acc+1, i^1)
  }._1

  val res1 = s./:(0,1) { case ((acc,i), c) =>
    if(c == i) (acc, i^1) else (acc+1, i^1)
  }._1

  val ans = res0 min res1
  println(ans)
}