fun main(args: Array<String>) {
    val s = readLine()!!
    val even = s.slice(0..s.length-1 step 2)
    val odd = s.slice(1..s.length-1 step 2)

    val ans = Math.min(
        even.count { it=='1' } + odd.count { it=='0' },
        even.count { it=='0' } + odd.count { it=='1' }
    )
    println(ans)

}