s = gets.chomp.chars
i = 0
count = 0
while i < s.size
  if i % 2 == 0 
    if s[i] == "1"
      count += 1
    end
  else
    if s[i] == "0"
      count += 1
    end
  end
  i += 1
end
puts [count,s.size-count].min