fun main(args:Array<String>) {
    val s = readLine()!!
    var curA = '0'
    var curB = '1'
    var cntA = 0
    var cntB = 0
    for(i in s) {
        if(i != curA) {
            cntA++
        }
        if(i != curB) {
            cntB++
        }
        curA = flip(curA)
        curB = flip(curB)
    }
    val ans = Math.min(cntA,cntB)
    println(ans)
}

fun flip(cur:Char):Char {
    if(cur == '0') {
        return '1'
    } else {
        return '0'
    }
}