fun main(args: Array<String>) {
    val S = readLine()!!

    val a = S.mapIndexed { idx, c -> if (idx % 2 == 0 && c == '0' || idx % 2 == 1 && c == '1') 0 else 1 }.sum()
    val b = S.mapIndexed { idx, c -> if (idx % 2 == 0 && c == '1' || idx % 2 == 1 && c == '0') 0 else 1 }.sum()
    println(Math.min(
        a,
        b
    ))
}
