fun main(args: Array<String>) {

    val S = readLine()!!

    var zeroOrigin = 0
    var oneOrigin = 0

    for (i in S.indices) {
        if (i % 2 == 0) {
            if (S[i] == '0') {
                zeroOrigin++
            }
        } else {
            if (S[i] == '1') {
                zeroOrigin++
            }
        }
    }
    for (i in S.indices) {
        if (i % 2 == 1) {
            if (S[i] == '0') {
                oneOrigin++
            }
        } else {
            if (S[i] == '1') {
                oneOrigin++
            }
        }
    }

    Math.min(S.length - oneOrigin, S.length - zeroOrigin).let(::println)
}

