fun main(args: Array<String>) {
    val tiles = readLine()!!
    val l = tiles.length

    var b = Array(l){'0'}
    var w = Array(l){'1'}
    for (i in 0 until l){
        if(i % 2 == 0){
            b[i] = '0'
            w[i] = '1'
        }else{
            b[i] = '1'
            w[i] = '0'
        }
    }

    var bc = 0
    var wc = 0

    tiles.forEachIndexed { index, c ->
        if(c != b[index]){
            bc++
        }

        if(c != w[index]){
            wc++
        }
    }

    println(Math.min(bc, wc))
}
