#include <bits/stdc++.h>
#define REP(i, a, n) for (long long i = (a); i < (long long)(n); ++i)
#define REPC(i, a, n) for (long long i = (a); i <= (long long)(n); ++i)
#define ALL(t) t.begin(), t.end()
#define RALL(t) t.rbegin(), t.rend()
#define MATINIT(type, row, col, init) \
  vector<vector<type>>(row, vector<type>(col, init));
#define Yes(cond) cout << (cond ? "Yes" : "No") << endl;
#define YES(cond) cout << (cond ? "YES" : "NO") << endl;
using namespace std;
using LL = long long;
using ULL = unsigned long long;
template <class T>
using VEC = std::vector<T>;
template <class T>
using MAT = std::vector<std::vector<T>>;
void DUMP() { cerr << endl; }
template <class Head, class... Tail>
void DUMP(Head &&head, Tail &&... tail) {
  cerr << head << ", ";
  DUMP(std::move(tail)...);
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &vec) {
  os << "{";
  for (auto v : vec) os << v << ",";
  os << "}";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, set<T> &s) {
  os << "{";
  for (auto p : s) os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, map<T1, T2> &m) {
  os << "{";
  for (auto p : m) os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2> p) {
  os << "[" << p.first << " " << p.second << "]";
  return os;
}
#include <cmath>
#include <map>
#include <ostream>
#include <vector>
struct PrimeFactorization {
  std::map<long long, long long> pf;
  PrimeFactorization() {}
  PrimeFactorization(long long n) {
    // nを素因数分解する(n==0, 1時に振る舞いが独特なので注意)

    // n==0, n==1 の取扱
    if (n == 0) {
      pf[0] = 1;
    }
    if (n == 1) {
      pf[0] = 0;
    }

    for (long long i = 2; i * i <= n; ++i) {
      while (n % i == 0) {
        n /= i;
        ++pf[i];
      }
    }
    if (n > 1) {
      ++pf[n];
    }
  }
  static PrimeFactorization lcm(const std::vector<long long> &a) {
    // calculate lcm of an array, result is prime factorized.
    // https://atcoder.jp/contests/abc152/tasks/abc152_e
    PrimeFactorization res;
    for (auto v : a) {
      PrimeFactorization p(v);
      for (auto e : p.pf) {
        res.pf[e.first] = std::max(res.pf[e.first], e.second);
      }
    }
    return res;
  }
  long long getInt() {
    long long res = 1;
    for (auto v : pf) {
      res *= pow(v.first, v.second);
    }
    return res;
  }
  long long getIntWithMod(long long M) {
    long long res = 1;
    for (auto v : pf) {
      res = res * modpow(v.first, v.second, M) % M;
    }
    return res;
  }
  PrimeFactorization &operator*=(const PrimeFactorization &a) {
    for (auto v : a.pf) {
      pf[v.first] += v.second;
    }
    return *this;
  }
  PrimeFactorization &operator/=(const PrimeFactorization &a) {
    for (auto v : a.pf) {
      pf[v.first] -= v.second;
    }
    return *this;
  }
  PrimeFactorization operator*(const PrimeFactorization &a) {
    PrimeFactorization res(*this);
    return res *= a;
  }
  PrimeFactorization operator/(const PrimeFactorization &a) {
    PrimeFactorization res(*this);
    return res /= a;
  }

 private:
  /* calculate n^p mod M. O(log(p)) */ long long modpow(long long n,
                                                        long long p,
                                                        long long M) {
    long long ans = 1;
    while (p > 0) {
      if (p & 1) ans = (ans * n) % M;
      n = (n * n) % M;
      p >>= 1;
    }
    return ans;
  }
};

std::ostream &operator<<(std::ostream &os, const PrimeFactorization &a) {
  os << "{";
  for (auto v : a.pf) {
    os << v.first << ": " << v.second << ", ";
  }
  os << "}";
  return os;
}

bool isPrime(
    int n) { /* returns whether n is prime number or not * n should be in range
                [0, lim]. * to see detail, search 'Sieve of Eratosthenes' */
  static int lim = 1e6 + 1;
  static bool done = false;
  static vector<bool> isp(lim + 1, 1);
  if (!done) {
    isp[0] = isp[1] = false;
    for (int i = 2; i <= lim; i++) {
      if (isp[i]) {
        for (int j = i + i; j <= lim; j += i) {
          isp[j] = false;
        }
      }
    }
    done = true;
  }
  return isp[n];
}

int main() {
  int N;
  cin >> N;
  VEC<int> A(N);
  REP(i, 0, N) cin >> A[i];
  // VEC<PrimeFactorization> P(N);
  // map<int, int> sum;
  // REP(i, 0, N) {
  //   P[i] = PrimeFactorization(A[i]);
  //   for (auto &v : P[i].pf) {
  //     sum[v.first] +=
  //   }
  // }
  map<int, int> dict;
  map<int, int> cand;
  sort(ALL(A));
  int size = A[N - 1] + 1;
  VEC<bool> ava(size, 1);
  REP(i, 0, N) {
    if (ava[A[i]]) {
      int k = A[i];
      cand[A[i]]++;
      while (k < size) {
        ava[k] = 0;
        k += A[i];
      }
    }
    else {
      if (cand[A[i]] > 0) cand[A[i]] = 0;
    }
    // DUMP(i, cand, ava);
    // // DUMP(i, dict, A[i], isPrime(A[i]));
    // if (isPrime(A[i])) {
    //   // DUMP("A");
    //   dict[A[i]]++;
    // } else if (dict[A[i]] != 0) {
    //   // DUMP("B");
    //   dict[A[i]]++;
    // } else {
    //   // DUMP("C");
    //   bool all = 1;
    //   for (auto &v : dict) {
    //     if (v.second == 0) continue;
    //     // DUMP("v", v);
    //     if ((A[i] % v.first) == 0) {
    //       all = 0;
    //       break;
    //     }
    //   }
    //   if (all) {
    //     // DUMP("in all", dict);
    //     dict[A[i]]++;
    //     // DUMP("in all", dict);
    //   }
    // }
  }
  // DUMP(cand);
  int cnt = 0;
  for (auto &v : cand) {
    if (v.second == 1) {
      cnt++;
    }
  }
  cout << cnt << endl;

  return 0;
}


Measured memory_bytes: 13428