#include <bits/stdc++.h>
void eratosthenes(int prim[]) {
  int i, j;
  for (i = 0; i < 10000; i++) prim[i] = 1;
  prim[0] = prim[1] = 0;
  for (i = 2; i * i <= 10000; i++) {
    if (!prim[i]) continue;
    for (j = i + i; j <= 10000; j += i) prim[j] = 0;
  }
}
int main() {
  int prim[10000 + 10];
  int n, val, ans = 0;
  int i;
  eratosthenes(prim);
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &val);
    if (prim[val]) ans++;
  }
  printf("%d\n", ans);
  return 0;
}
