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