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