fun main(args: Array<String>) {
    val s = readLine()!!
    var e0 = 0
    var o0 = 0
    for (i in 0 until s.length) {
        val c = s[i]
        if (i and 1 == 0) {
            if (c == '0') o0++
        } else {
            if (c == '0') e0++
        }
    }
    val es = s.length shr 1
    val os = if (s.length and 1 == 0) es else es + 1
    println(Math.min(e0 + os - o0, o0 + es - e0))
}
