s = gets
l = s.length - 1
c1 = 0
c2 = 0

for i in 0 .. l - 1
  if i % 2 == 0
    if s[i] == "1"
      c1 += 1
    else
      c2 += 1
    end
  else
    if s[i] == "1"
      c2 += 1
    else
      c1 += 1
    end
  end
end

puts [c1,c2].min
