fun main(args: Array<String>) {
    val s = readLine()!!
    println(Math.min(
        s.filterIndexed { idx, c -> idx % 2 == c - '0' }.count(),
        s.filterIndexed { idx, c -> idx % 2 != c - '0' }.count()))
}