#include <bits/stdc++.h>
int sosuu(int);
int main() {
  int a, b, c, count1 = 0;
  scanf("%d", &a);
  for (int i = 0; i < a; i++) {
    scanf("%d", &b);
    c = sosuu(b);
    if (c == 1) count1++;
  }
  printf("%d\n", count1);
  return 0;
}
int sosuu(int x) {
  int i, c;
  double d = sqrt(x);
  if (x == 2) return c = 1;
  if (x < 2 || x % 2 == 0) return c = 0;
  i = 3;
  while (i < d) {
    if (x % i == 0) return c = 0;
    i = i + 2;
  }
  return c = 1;
}
