#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int datanum;
  int* databuff;
  int* primecheck;
  int maxnum;
  int primecnt;
  primecnt = 0;
  maxnum = 0;
  cin >> datanum;
  databuff = new int[datanum];
  for (int i = 0; i < datanum; i++) {
    cin >> databuff[i];
    if (databuff[i] > maxnum) {
      maxnum = databuff[i];
    }
  }
  primecheck = new int[maxnum + 1];
  for (int i = 2; i <= maxnum; i++) {
    primecheck[i] = 1;
  }
  for (int i = 2; i <= maxnum; i++) {
    if (primecheck[i] == 1) {
      for (int j = 2 * i; j <= maxnum; j++) {
        if (j % i == 0) {
          primecheck[j] = 0;
        }
      }
    }
  }
  for (int i = 0; i < datanum; i++) {
    if (primecheck[databuff[i]] == 1) {
      primecnt++;
    }
  }
  cout << primecnt << endl;
  return 0;
}
