#include <bits/stdc++.h>
int main() {
  int n, i, j, c = 0, a, p[100000] = {};
  p[0] = p[1] = 1;
  for (i = 2; i < 100000; i++)
    if (p[i] == 0)
      for (j = i * 2; j < 100000; j += i) p[j] = 1;
  scanf("%d", &n);
  while (n--) {
    scanf("%d", &a);
    if (p[a] == 0) c++;
  }
  printf("%d\n", c);
  return 0;
}
