fun main(args: Array<String>) {
    val lines = readLine()!!.split("").filter { it.isNotEmpty() }

    val odd = lines.filterIndexed { index, s -> index % 2 == 0 }
    val even = lines.filterIndexed { index, s -> index % 2 == 1 }

    val odd0 = odd.count { s -> s == "0" }
    val odd1 = odd.size - odd0
    val even0 = even.count { s -> s == "0" }
    val even1 = even.size - even0

    val odd0AndEven1 = odd1 + even0
    val odd1AndEven0 = odd0 + even1

    print(arrayListOf(odd0AndEven1, odd1AndEven0).min())
}