fun main(args: Array<String>) {
    val input = readLine()!!
    val t0 = "01".repeat(input.length/2) + if (input.length%2 == 1) "0" else ""
    val t1 = "10".repeat(input.length/2) + if (input.length%2 == 1) "1" else ""

    var a = difCount(input, t0)
    var b = difCount(input, t1)
    print(if(a > b)b else a)
}

fun difCount(input: String, t0: String): Int {
    var count = 0
    for(i in 0 until input.length){
        if(input[i] == t0[i])count++
    }
    return count
}
