#include <bits/stdc++.h>
int isprime(int);
static const int N = 1000;
int main() {
  int n, i, h, z = 0;
  int x[N + 1];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x[i]);
    h = isprime(x[i]);
    if (h == 1) z++;
  }
  printf("%d\n", z);
  return 0;
}
int isprime(int x) {
  int i;
  if (x == 2)
    return 1;
  else if (x < 2 || x % 2 == 0)
    return 0;
  i = 3;
  while (i <= sqrt((double)x)) {
    if (x % i == 0) return 0;
    i = i + 2;
  }
  return 1;
}
