s = gets.chomp.split("")
len = s.length
p01 = 0
p10 = 0
len.times do |i|
  if i % 2 == 0
    p01 += 1 if s[i] == "1"
    p10 += 1 if s[i] == "0"
  else
    p01 += 1 if s[i] == "0"
    p10 += 1 if s[i] == "1"
  end
end
puts [p01,p10].min
