tiles = gets.strip.split('').map(&:to_i)
count = 0
prev_tile = nil
tiles.each_with_index do |tile, index|
  if index == 0
    prev_tile = tile
  else
    if tile == prev_tile
      prev_tile = tile == 1 ? 0 : 1
      count += 1
    else
      prev_tile = tile
    end
  end
end

puts count