s = gets.chomp
n = s.length
a = 0
n.times do |i|
  if i.even?
    if s[i] != "0"
      a += 1
    end
  else
    if s[i] != "1"
      a += 1
    end
  end
end

b = 0
n.times do |i|
  if i.even?
    if s[i] != "1"
      b += 1
    end
  else
    if s[i] != "0"
      b += 1
    end
  end
end

puts [a, b].min