fun main(args: Array<String>) {
    val s = readLine()!!
    val array = s.map{ it - '0' }
    val sb = StringBuilder().append(array[0])
    var current = array[0]
    var count = 0
    for (i in 1..(s.length-1)) {
        if (array[i] == current) {
            current = if (current == 0) {
                sb.append("1")
                1
            } else {
                sb.append("0")
                0
            }
            count++
        } else {
            sb.append(array[i].toString())
            current = array[i]
        }
    }
    println(count)
}

