object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val S = sc.next
    var blackFirst = 0
    var whiteFirst = 0
    for (i <- 0 until S.length) {
      if (i % 2 == 0) {
        if (S(i) == '1') {
          blackFirst += 1
        } else {
          whiteFirst += 1
        }
      } else {
        if (S(i) == '0') {
          blackFirst += 1
        } else {
          whiteFirst += 1
        }
      }
    }
    val result = Math.min(blackFirst, whiteFirst)
    println(result)
  }
}
