#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using i128 = boost::multiprecision::int128_t;
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using Vbo = vector<bool>;
using VV = vector<V>;
using VVll = vector<Vll>;
using VVld = vector<Vld>;
using VVbo = vector<Vbo>;
using VVV = vector<VV>;
using VVVll = vector<VVll>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
#define rep2(i, m, n) for(ll i=int(m); i<int(n); ++i)
#define drep2(i, m, n) for(ll i=int(m)-1; i>=int(n); --i)
#define rep(i, n) rep2(i, 0, n)
#define drep(i, n) drep2(i, n, 0)
#define all(a) a.begin(), a.end()
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (auto &e : v) is >> e; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << " "; return os; }
template<typename T> inline int count_between(vector<T> &a, T l, T r) { return lower_bound(all(a), r) - lower_bound(all(a), l); } // [l, r)
inline int Log2(ll x) { int k; for (k = 0; x > 0; ++k) x >>= 1; return k; } // number of binary digits
const int INF  = 1<<30;
const ll INFll = 1ll<<62;
const ld EPS   = 1e-10;
const ld PI    = acos(-1.0);
const int MOD  = int(1e9)+7;
// const int MOD  = 998244353;


struct Eratos {
  vector<int> primes, min_factor;
  vector<bool> isprime;
  Eratos(int MAX) : primes(), isprime(MAX+1, true), min_factor(MAX+1, -1) {
    isprime[0] = isprime[1] = false;
    min_factor[0] = 0, min_factor[1] = 1;
    for (int i = 2; i <= MAX; i++) {
      if (!isprime[i]) continue;
      primes.push_back(i);
      min_factor[i] = i;
      for (int j = i*2; j <= MAX; j += i) {
        isprime[j] = false;
        if (min_factor[j] == -1) min_factor[j] = i;
      }
    }
  }
  // prime factorization
  vector<pair<int,int>> factorize(int n) {
    vector<pair<int,int>> res;
    while (n != 1) {
      int prime = min_factor[n];
      int exp = 0;
      while (min_factor[n] == prime) { ++exp; n /= prime; }
      res.emplace_back(prime, exp);
    }
    return res;
  }
  // enumerate divisors
  vector<int> divisors(int n) {
    vector<int> res({1});
    auto pf = factorize(n);
    for (auto p : pf) {
      int k = res.size();
      for (int i = 0; i < k; ++i) {
        int v = 1;
        for (int j = 0; j < p.second; ++j) {
          v *= p.first;
          res.push_back(res[i] * v);
        }
      }
    }
    return res;
  }
};


int main() {
  ll n; cin >> n;
  const int M = 1e6+1;
  V a(n); cin >> a;
  V cnt(M);
  rep(i, n) ++cnt[a[i]];


  Eratos er(M);

  ll ans = 0;
  rep(i, n) {
    auto div = er.divisors(a[i]);
    bool ok = true;
    for (auto e : div) {
      if (e == a[i]) {
        if (cnt[e] > 1) ok = false;
      }
      else {
        if (cnt[e]) ok = false;
      }
    }
    if (ok) ++ans;
  }

  cout << ans << "\n";
  return 0;
}


Measured memory_bytes: 12608