import java.util.*

fun main(args:Array<String>){
    val s = readLine()!!
    var cnt1 = 0
    var cnt2 = 0
    for(i in 0 until s.length){
        if(i % 2 == 0){
            if(s[i] == '0') cnt2++
            else cnt1++
        }
        else{
            if(s[i] == '0') cnt1++
            else cnt2++
        }
    }
    println(Math.min(cnt1, cnt2))
}
