#include <bits/stdc++.h>
using namespace std;
bool sive_array[100000009];
void sive() {
  long long int i, j;
  sive_array[0] = true;
  sive_array[1] = true;
  for (i = 4; i <= 100000000; i += 2) sive_array[i] = true;
  for (i = 3; i <= 10000; i += 2) {
    if (sive_array[i] == false) {
      for (j = i * i; j <= 100000000; j += 2 * i) sive_array[j] = true;
    }
  }
}
int main() {
  sive();
  int n, q, x = 0;
  scanf("%d", &n);
  while (n--) {
    scanf("%d", &q);
    x += !sive_array[q];
  }
  printf("%d\n", x);
  return 0;
}
