import scala.io.StdIn

object Main extends App {
  val input = StdIn.readLine().toCharArray()
  var count = 0
  check(input, 0, false)
  println(count)
  def check(i: Array[Char], idx: Int, isPW: Boolean): Unit = {
    if (idx >= i.length)
      return
    var isNW = if (i(idx) == "0") true else false
    if (idx != 0 && isPW == isNW) {
      count += 1
      isNW = !isNW
    }

    val nIdx = idx + 1
    check(i, nIdx, isNW)
  }
}