import Foundation

var s : String = readLine()!

var i = 0
var j = 1
var count = 0
var resultA = 0
var resultB = 0

for num in s.characters{
    //正しい場合
    if (num == "0" && count%2 == 0){
        
    }else if(num == "1" && count%2 == 1){
        
    }else{//正しく無い場合
        resultA = resultA + 1
    }
    count = count + 1
}

for num in s.characters{
    //正しい場合
    if (num == "1" && count%2 == 0){
        
    }else if(num == "0" && count%2 == 1){
        
    }else{//正しく無い場合
        resultB = resultB + 1
    }
    count = count + 1
}

if(resultA < resultB){
    print(resultA)
}else{
    print(resultB)
}
