#include <bits/stdc++.h>
int prime(int n) {
  int a;
  if (n < 2) return 0;
  if (n == 2) return 1;
  if (n % 2 == 0) return 0;
  for (a = 3; a * a <= n; a += 2)
    if (n % a == 0) return 0;
  return 1;
}
int main(void) {
  int b, c, d = 0, e;
  scanf("%d", &c);
  for (b = 0; b < d; b++) {
    scanf("%d", &e);
    d += prime(e);
  }
  printf("%d\n", d);
  return 0;
}
