#include <bits/stdc++.h>
using namespace std;
int checkPrime(long long ele) {
  if (ele == 1) return 0;
  if (ele == 2 || ele == 3) return 1;
  if (ele % 2 == 0 || ele % 3 == 0) return 0;
  for (long long i = 5; i * i <= ele; i = +6)
    if (ele % i == 0 || ele % (i + 2) == 0) return 0;
  return 1;
}
int main() {
  int n, temp;
  int tot = 0;
  long long dig;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &dig);
    tot += checkPrime(dig);
  }
  printf("%d\n", tot);
  return 0;
}
