##templete
s = gets.chomp

leng = s.length


even = '0'
odd = '1'

count1 = 0
count2 = 0
for i in 0..leng-1 do
  if i % 2 == 0
    count1 += 1 if s[i] != even
    count2 += 1 if s[i] != odd
  else
    count1 += 1 if s[i] != odd
    count2 += 1 if s[i] != even
  end
end

ans = count1 > count2 ? count2 : count1
puts ans
