#include <bits/stdc++.h>
using namespace std;
int a[100000090];
vector<int> vc;
void sieve() {
  int i, j;
  a[1] = 1;
  vc.push_back(2);
  for (i = 4; i <= 100000030; i += 2) a[i] = 1;
  for (i = 3; i <= 100000030; i += 2) {
    if (a[i] == 0) {
      for (j = 3 * i; j <= 100000030; j = j + i * 2) a[j] = 1;
      vc.push_back(i);
    }
  }
}
int main() {
  sieve();
  int i, j, k, l = 0, n;
  scanf("%d", &n);
  while (n--) {
    scanf("%d", &k);
    if (a[k] == 0) l++;
  }
  printf("%d\n", l);
  return 0;
}
