s = gets.chomp

s0 = "01" * (s.size/2 + 1)
s1 = "10" * (s.size/2 + 1)

c0 = 0
c1 = 0

s.size.times do |i|
  if s0[i] != s[i]
    c0 += 1
  end
  if s1[i] != s[i]
    c1 += 1
  end
end

puts [c0, c1].min

  