#coding: euc-jp
class Main
  def self.main
    s = read
    n = s.length
    count = 0
    col = s[0].to_i
    1.upto (n-1) do |i|
      col = (col + 1) % 2
      count += 1 if s[i].to_i != col
    end
    count = count <= n / 2 ? count : n - count
    puts count
  end

  def self.read
    gets.chomp
  end
end

Main.main
