const args = input.trim().split("\n");
const Ai = args[1]
  .trim()
  .split(" ")
  .map((n) => parseInt(n, 10));

const MAX = 10 ** 6;
const checkMarks = new Array(MAX).fill(0);

[...Ai].flatMap((a) => {
  checkMarks[a] += 2;
  [...checkMarks.keys()].map((i) => {
    const position = (i + 2) * a;
    if (position > MAX) return;
    checkMarks[position] = 1;
  });
});

const isNotChecked = (n) => checkMarks[n] === 0 || checkMarks[n] === 2;
const count = Ai.filter(isNotChecked).length;

console.log(count);