fun main(args : Array<String>) {
    val S = readLine()!!

    // 先頭を0にする場合
    var next = '0'
    var answer1 = 0
    fun flip(num: Char) : Char {
        if (num == '0') {
            return '1'
        }

        return '0'
    }

    S.forEach {
        if (it != next) {
            answer1++
        }
        next = flip(next)
    }

    next = '1'
    var answer2 = 0
    // 1にする場合
    S.forEach {
        if (it != next) {
            answer2++
        }
        next = flip(next)
    }

    println(listOf(answer1, answer2).min())
}