fun main(args: Array<String>) {
    abc124c()
}

fun abc124c() {
    val black = '0'
    val isBlackList = readLine()!!.toCharArray().map { it == black }

    // 最初がblack(0101..のパターン)への塗替えが必要な数
    val firstBlack = isBlackList.filterIndexed { index, isBlack ->
        val needBlack = index % 2 == 0
         needBlack != isBlack
    }.count()

    // 最初がwhite(1010..のパターン)への塗替えが必要な数
    val firstWhite = isBlackList.filterIndexed { index, isBlack ->
        val needBlack = index % 2 != 0
        needBlack != isBlack
    }.count()

    println(Math.min(firstBlack, firstWhite))
}
