const chunks = [];
process.stdin.on("data", (chunk) => {
  chunks.push(chunk);
});
process.stdin.on("end", () => {
  const lines = Buffer.concat(chunks)
    .toString("utf8")
    .trim()
    .split("\n")
    .map((line) => line.split(" ").map((s) => parseInt(s, 10)));
  const [N] = lines[0];
  const A = lines[1];
  console.log(solve(N, A));
});

// Ai is not divisible by any other numbers in A.
// O(N^2) is not acceptable.
// If A has 1, the answer is 0?
// If there are equal nubmers, they can't be i.
// Ai is not divisible by Aj when:
// - Ai is smaller than Aj
//
// Enumerate divisors and check if each of them is in A.

class Counter extends Map {
  increment(key) {
    if (this.has(key)) {
      this.set(key, this.get(key) + 1);
    } else {
      this.set(key, 1);
    }
  }
}

function solve(N, A) {
  const counter = new Counter();
  for (const a of A) {
    counter.increment(a);
  }

  if (counter.has(1)) {
    return counter.get(1) === 1 ? 1 : 0;
  }

  let result = 0;
  for (const [key, count] of counter.entries()) {
    if (count > 1) continue;
    if (check(key)) result++;
  }
  return result;

  function check(key) {
    const sqrt = Math.floor(Math.sqrt(key));
    for (let i = 2; i <= sqrt; i++) {
      if (key % i === 0) {
        if (counter.has(i)) return false;
        if (counter.has(key / i)) return false;
      }
    }
    return true;
  }
}
