defmodule Main do
  def main do
    _n = IO.gets("") |> String.trim() |> String.to_integer()

    list =
      IO.gets("")
      |> String.trim()
      |> String.split()
      |> Enum.map(&String.to_integer/1)
      |> Enum.sort()

    divisible_num([], list, 0)
    |> IO.puts()
  end

  defp divisible_num([], [num | rest], count) do
    case Enum.member?(rest, num) do
      true ->
        divisible_num([num], rest, count)

      false ->
        divisible_num([num], rest, count + 1)
    end
  end

  defp divisible_num(done_list, [num | []], count) do
    case Enum.find(done_list, fn x -> rem(num, x) == 0 end) do
      nil ->
        count + 1

      _number ->
        count
    end
  end

  defp divisible_num(done_list, [num | rest], count) do
    case Enum.find(done_list, fn x -> rem(num, x) == 0 end) do
      nil ->
        divisible_num([num | done_list], rest, count + 1)

      _number ->
        divisible_num([num | done_list], rest, count)
    end
  end
end