S = io.read()
a, b, c, d = 0, 0, 0, 0

for i=1, #S do
    if i%2==0 then
        a = a + 1
        if S:sub(i,i)=="0" then
        b = b + 1
        end
    elseif i%2==1 then
        c = c + 1
        if S:sub(i,i)=="1" then
            d = d + 1
        end
    end
end
print(math.min(b+d, a+c-(b+d)))