#include <bits/stdc++.h>
using namespace std;
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;
}
int main(void) {
  vector<int> primes;
  int max_num = 10000;
  seive(primes, max_num);
  int n, n0, lim, count;
  cin >> n;
  count = n;
  for (int i = 0; i < n; i++) {
    cin >> n0;
    lim = int(sqrt(n0));
    for (int j = 0; j < (int)primes.size(); j++) {
      int tmp = primes[j];
      if (tmp * tmp > n0) break;
      if (n0 % tmp == 0) {
        count--;
        break;
      }
    }
  }
  cout << count << endl;
  return 0;
}
