input = gets
input.chomp!

s = input.split("")
n = s.size

oddB = 0
evenW = 0
for i in 1..n do
    if i % 2 == 1 and s[i-1] == "0"
        oddB += 1
    elsif i % 2 == 0 and s[i-1] == "1"
        evenW += 1
    end
end

bwb = oddB + evenW
wbw = n - bwb

if bwb > wbw
    p wbw
else
    p bwb
end