#include <bits/stdc++.h>

using namespace std;
using int64 = long long;

constexpr int DEBUG = 0;
constexpr int MAX_X = 1000000;

int PowerMod(int64 base, int power, int mod) {
  base %= mod;
  int64 result = 1;
  while (power > 0) {
    if (power % 2 == 1) {
      result = (result * base) % mod;
    }
    base = (base * base) % mod;
    power /= 2;
  }
  return result;
}

bool IsPrimeMillarRabin(int x) {
  if (x == 1) return false;
  if (x == 2) return true;
  if (x % 2 == 0) return false;
  int s = 0;
  int d = x - 1;
  while (d % 2 == 0) {
    s++;
    d /= 2;
  }
  for (int a : {2, 3, 61}) {
    if (a >= x) continue;
    int64 y = PowerMod(a, d, x);
    if (y == 1 || y == x - 1) continue;
    for (int i = 0; i < s; i++) {
      y = (y * y) % x;
      if (y == x - 1) break;
    }
    if (y == x - 1) continue;
    return false;
  }
  return true;
}

vector<pair<int, int>> FactorizePollardRho(int n) {
  static const vector<int> kPrimes = {2, 3, 5, 7, 11, 13, 17, 19};
  vector<int> ps;
  for (int prime : kPrimes) {
    while (n % prime == 0) {
      n /= prime;
      ps.push_back(prime);
    }
  }

  function<void(int, vector<int>&)> extract_fn =
      [&extract_fn](int n, vector<int>&ps) {
    if (n == 1) return;
    if (IsPrimeMillarRabin(n)) {
      ps.push_back(n);
      return;
    }
    for (int c = 1; c <= 100; c++) {
      int64 x = 2;
      int64 y = 2;
      int d = 1;
      while (d == 1) {
        x = (x * x + c) % n;
        y = (y * y + c) % n;
        y = (y * y + c) % n;
        d = __gcd(static_cast<int>(abs(x - y)), n);
      }
      if (d == n) {
        continue;
      }
      extract_fn(d, ps);
      extract_fn(n / d, ps);
      return;
    }
    cerr << "FactorizePollardRho() failed!" << endl;
    exit(1);
  };
  extract_fn(n, ps);
  sort(ps.begin(), ps.end());
  vector<pair<int, int>> outputs;
  for (int p : ps) {
    if (outputs.empty()) {
      outputs.push_back({p, 1});
    } else if (outputs.back().first == p) {
      outputs.back().second++;
    } else {
      outputs.push_back({p, 1});
    }
  }
  return outputs;
}

vector<int> GetDivisors(int n) {
  auto factors = FactorizePollardRho(n);
  vector<int> ds;
  function<void(int, int)> dfs_fn = [&](int x, int depth) {
    if (depth == factors.size()) {
      ds.push_back(x);
      return;
    }
    for (int i = 0; i <= factors[depth].second; i++) {
      dfs_fn(x, depth + 1);
      x *= factors[depth].first;
    }
  };
  dfs_fn(1, 0);
  sort(ds.begin(), ds.end());
  return ds;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  int n;
  cin >> n;
  vector<int> xs(n);
  vector<int> count_map(MAX_X + 1);
  for (int i = 0; i < n; i++) {
    cin >> xs[i];
    count_map[xs[i]]++;
  }
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  if (count_map[1] >= 1) {
    if (count_map[1] == 1) {
      cout << 1 << endl;
      return 0;
    } else {
      cout << 0 << endl;
      return 0;
    }
  }

  int solution = 0;
  for (int i = 0; i < n; i++) {
    if (count_map[xs[i]] >= 2) continue;
    bool valid = true;
    auto ds = GetDivisors(xs[i]);
    for (int d : ds) {
      if (d == 1 || d == xs[i]) continue;
      int e = xs[i] / d;
      if (count_map[d] || count_map[e]) {
        valid = false;
      }
    }
    if (valid) {
      solution++;
    }
  }
  cout << solution << endl;
}

Measured memory_bytes: 7920