fun main(args: Array<String>) {
    val S = next().map { it - '0' }
    fun count(d: Int) = S.withIndex().sumBy { if (it.index % 2 == d) it.value else 1 - it.value }
    println(Math.min(count(0), count(1)))
}
fun next() = readLine()!!