#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, A, M = 1e6+1;
  vector<int> V(M);
  cin >> N;
  while (cin >> A) V.at(A)++;
  int ans = 0;
  for (int i = 0; i < M; i++) {
    if (V.at(i) == 0) continue;
    if (V.at(i) == 1) ans++;
    for (int j = 0; i * j < M; j++) V.at(i * j) = 0;
  }
  cout << ans << "\n";
}