fun main(args:Array<String>) {
    val s= readLine()!!.toString()
    val n=s.length
    val a=n/2
    val b=if (n%2==1) a+1
        else a
    var suma=0
    var sumb=0
    for (i in 0 until n){
        if (i%2==0){
            if (s[i]=='1') suma++
        }
        else{
            if (s[i]=='1') sumb++
        }
    }
    var ca=(b-suma)+sumb
    var cb=(a-sumb)+suma
    println(
        if (n==1) 0
        else Math.min(ca,cb)
    )
}
