# frozen_string_literal: true

s = gets.chomp
n = s.chomp.size
even = odd = 0

0.step(n - 1, 2) do |i|
  if s[i] == '1'
    even += 1
  else
    odd += 1
  end
end

1.step(n - 1, 2) do |i|
  if s[i] == '0'
    even += 1
  else
    odd += 1
  end
end

puts even < odd ? even : odd