s = gets.chomp
a = 0
b = 0

for i in 0...s.size
  if i % 2 == 0 then
    if s[i] == "1" then
      a += 1
    else
      b += 1
    end
  else
    if s[i] == "1" then
      b += 1
    else
      a += 1
    end
  end
end

puts [a, b].min
