let S = readLine()!.characters.map{String($0)}
var (tile1, tile2) = (0, 0)
for i in 0..<S.count {
    if i % 2 > 0 {
        S[i]=="0" ? tile1++ : tile2++
    } else {
        S[i]=="1" ? tile1++ : tile2++
    }
}
print(min(tile1, tile2))