object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val s = sc.next()
  lazy val reverses: LazyList[Char] = '1' #:: '0' #:: reverses
  val mismatched: PartialFunction[(Char, Char), Boolean] = {
    case (l, r) => l != r
  }
  println(reverses.zip(s).count(mismatched) min reverses.tail.zip(s).count(mismatched))
}
