#include <bits/stdc++.h>
using namespace std;
int prs[1000];
int pri = 1;
int geneprs(int max) {
  int flg;
  for (int i = prs[pri] + 2; i <= max; i += 2) {
    flg = 1;
    for (int j = 1; sqrt(i) < prs[j]; j++)
      if (i % prs[j] == 0) {
        flg = 0;
        break;
      }
    if (flg) prs[++pri] = i;
  }
}
int isPrime(int a) {
  int reqpr = sqrt(a);
  if (reqpr + 1 >= prs[pri]) geneprs(reqpr + 1);
  for (int i = 0; prs[i] <= reqpr; i++) {
    if (a % prs[i] == 0) return 0;
  }
  return 1;
}
int main() {
  int n, a, cnt = 0;
  prs[0] = 2;
  prs[1] = 3;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    cnt += isPrime(a);
  }
  cout << cnt << endl;
  return 0;
}
