#include <bits/stdc++.h>
void sieve(int*, int);
int primep[100000001];
int main(void) {
  int n, x, count = 0, i;
  sieve(primep, 100000001);
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x);
    if (primep[x]) count++;
  }
  printf("%d\n", count);
  return 0;
}
void sieve(int* arr, int len) {
  int i, k;
  for (i = 0; i < len; i++) arr[i] = 1;
  arr[0] = arr[1] = 0;
  for (i = 0; i < len / 2; i++) {
    if (arr[i] == 0) continue;
    for (k = 2; i * k < len; k++) arr[i * k] = 0;
  }
}
