#include <bits/stdc++.h>
#define FOR(i, a, n) for(int (i) = (int)(a); (i) < (int)(n); ++(i))
#define FORe(i, a, n) for(int (i) = (int)(a); (i) <= (int)(n); ++(i))
#define rFOR(i, a, n) for(int (i) = (int)(n)-1; (i) >= (int)(a); --(i))
#define rFORe(i, a, n) for(int (i) = (int)(n); (i) >= (int)(a); --(i))
#define REP(i, n) FOR((i), 0, (n))
#define REPe(i, n) FORe((i), 1, (n))
#define REPo(i, n) FORe((i), 0, (n))
#define rREP(i, n) rFOR((i), 0, (n))
#define rREPe(i, n) rFORe((i), 1, (n))
#define rREPo(i, n) rFORe((i), 0, (n))
#define rep(i, n) FOR((i), 0, (n))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define fi first
#define se second
#define dup(x, y) (((x)+(y)-1)/(y))
#define vc(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
using ll = long long;
using P = pair<int,int>;
using pll = pair<ll,ll>;
using T = tuple<int,int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vs = vector<string>;
using vp = vector<P>;
using vt = vector<T>;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

struct Sieve {
  int n;
  vector<int> f, primes;
  Sieve(int n=1):n(n), f(n+1) {
    f[0] = f[1] = -1;
    for (ll i = 2; i <= n; ++i) {
      if (f[i]) continue;
      primes.push_back(i);
      f[i] = i;
      for (ll j = i*i; j <= n; j += i) {
        if (!f[j]) f[j] = i;
      }
    }
  }
  bool isPrime(int x) { return f[x] == x;}
  vector<int> factorList(int x) {
    vector<int> res;
    while (x != 1) {
      res.push_back(f[x]);
      x /= f[x];
    }
    return res;
  }
  vector<P> factor(int x) {
    vector<int> fl = factorList(x);
    if (fl.size() == 0) return {};
    vector<P> res(1, P(fl[0], 0));
    for (int p : fl) {
      if (res.back().first == p) {
        res.back().second++;
      } else {
        res.emplace_back(p, 1);
      }
    }
    return res;
  }
  vector<pair<ll,int>> factor(ll x) {
    vector<pair<ll,int>> res;
    for (int p : primes) {
      int y = 0;
      while (x%p == 0) x /= p, ++y;
      if (y != 0) res.emplace_back(p,y);
    }
    if (x != 1) res.emplace_back(x,1);
    return res;
  }
};

int main() {
  int n;
  cin>>n;
  vi a(n);
  REP(i, n) cin >> a[i];
  sort(all(a));
  vc(P) b;
  REP(i, n) {
    if(i==0) b.push_back(P(a[i],1));
    else {
      P p = b.back();
      if(p.first==a[i]) b.back().second++;
      else b.push_back(P(a[i],1));
    }
  }
  vi z;
  vi c(1000005);
  REP(i, b.size()) {
    bool ok = true;
    P p = b[i];
    int x = p.first;
    if (p.second != 1) ok = false;
    if (c[x]) ok = false;
    else {
      for (int j = x+x; j<1000002; j += x) {
        c[j] = 1;
      }
    }
    // REP(j, z.size()) {
    //   if(p.first % z[j] == 0) ok = false;
    //   if(x/z[j] < 2) break;
    // }
    if(ok) {
      z.push_back(p.first);
      // cout << p.first << endl;
    }
  }
  cout << z.size() << endl;

  // Sieve seive(1000000);
  // map<int,int> mp;
  // vvi lst(n);
  // ll tmp = 0;
  // REP(i, b.size()) {
  //   bool ok = true;
  //   auto v = seive.factor(b[i]);
  //   for (auto u : v) {
  //     int x = u.first;
  //     if(mp[x] > 0) ok = false;
  //     mp[x]++;
  //   }
  //   if(ok) {tmp++;
  //   cout << b[i] << endl;}
  // }
  
  // REP(i, n) {
  //   bool ok = true;
  //   REP(j, lst[i].size()) {
  //     int x = lst[i][j];
  //     if(mp[x] > 1) {
  //       ok = false;
  //       break;
  //     }
  //   }
  //   if(ok) tmp++;
  // }
  // ll ans = tmp;
  // cout << ans << endl;


  return 0;
}

Measured memory_bytes: 11324