import java.lang.Math
fun main(args: Array<String>) {
    val S = readLine()!!
    var c0 = 0
    var c1 = 0
    for (i in 0 until S.length) {
        if ((i % 2 == 0) == (S[i] == '1')) ++c0
        if ((i % 2 == 0) == (S[i] == '0')) ++c1
    }
    println(Math.min(c0, c1))
}