#include <bits/stdc++.h>
using namespace std;
int seive(vector<int> &A, int n);
int main(void) {
  vector<int> primes, nums;
  int n;
  cin >> n;
  nums.resize(n);
  for (int i = 0; i < n; i++) cin >> nums[i];
  sort(nums.begin(), nums.end());
  int max_num = nums[nums.size() - 1];
  seive(primes, max_num);
  for (int i = 0; i < (int)primes.size(); i++)
    for (int j = 0; j < (int)nums.size(); j++)
      if ((nums[j] >= pow(primes[i], 2)) && (nums[j] % primes[i] == 0))
        nums[j] = 0;
  int count = 0;
  for (int i = 0; i < (int)nums.size(); i++)
    if (nums[i]) count++;
  cout << count << endl;
  return 0;
}
int seive(vector<int> &A, int n) {
  vector<int> num(n + 1, 1);
  num[0] = 0, num[1] = 0;
  int count = 1, limit = int(sqrt(n));
  for (int i = 3; i <= n; i += 2)
    if (num[i]) {
      count++;
      if (i <= limit)
        for (int j = 3 * i; j <= n; j += 2 * i) num[j] = 0;
    }
  A.resize(count);
  A[0] = 2;
  int j = 1;
  for (int i = 3; i <= n; i += 2)
    if (num[i] == 1) A[j++] = i;
  return 0;
}
