s = gets.chomp

s01 = "01"*(s.length/2)+"0"*(s.length%2)
s10 = "10"*(s.length/2)+"1"*(s.length%2)

repaint01 = 0
repaint10 = 0

(0..s01.length-1).each do |i|
  if s01[i] != s[i]
    repaint01+=1
  end
end

(0..s10.length-1).each do |i|
  if s10[i] != s[i]
    repaint10+=1
  end
end

p [repaint01,repaint10].min