object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val s = sc.next()
  val reverse = (c: Char) => if (c != '1') '1' else '0'
  println {
    Seq('1', '0').map { start =>
      s.foldLeft(start -> 0) {
          case ((c, count), next) =>
            if (c == next) (reverse(c), count + 1) else (next, count)
        }
        ._2
    }.min
  }
}
