s = gets.chomp
array = s.chars.map(&:to_i)
count = 0

(1..array.size-1).each do |n|
  if array[n-1] == array[n]
    count += 1
    if array[n-1] == 0
      array[n] = 1
    else
      array[n] = 0
    end
  end
end

puts count