const main = (input) => {
  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 + 1).fill(0);

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

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

  console.log(count);
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));