fun main(args: Array<String>) = println(run {
    val s = readLine()!!.map { it-'0' }
    val n = s.size
    val wb = IntArray(n){ (it+1)%2 }
    val bw = IntArray(n){ it%2 }
    val max1 = s.indices.count { i -> s[i]!=wb[i] }
    val max2 = s.indices.count { i -> s[i]!=bw[i] }
    Math.min(max1, max2)
})