n = gets.chomp
x = n.chars

cnt_b = 0
cnt_w = 0
for i in 0..x.length-1
    if i % 2 ==0
        if x[i]=="0"
            cnt_b+=1
        end
    else
        if x[i]=="1"
            cnt_b+=1
        end
    end
end
#puts cnt_b

for i in 0..x.length-1
    if i % 2 ==0
        if x[i]=="1"
            cnt_w+=1
        end
    else
        if x[i]=="0"
            cnt_w+=1
        end
    end
end
#puts cnt_w
puts [cnt_b, cnt_w].min
