fun main(args: Array<String>) {
    var first: String = getInputStr()

    var count = 0
    first.reduce { a, b ->
        var num = b
        if(a.equals(b)) {
            if(a.equals('0')) {
                num = '1'
            } else {
                num = '0'
            }
            count++
        }
        num
    }
    println(count)
}

fun getInputStr() : String {
    return readLine()!!.toString()
}