#include <bits/stdc++.h>
using namespace std;
class PrimeNumbers {
 public:
  int solve(int n, int a[]);
  bool isPrime(int x);
};
int PrimeNumbers::solve(int n, int a[]) {
  int result = 0;
  for (int i = 0; i < n; i++) {
    if (isPrime(a[i])) result++;
  }
  return result;
}
bool PrimeNumbers::isPrime(int x) {
  if (x == 2) return true;
  for (int i = 2; i < x; i++) {
    if ((x % i) == 0) return false;
  }
  return true;
}
int main(void) {
  int n;
  int a[10000];
  PrimeNumbers *pn = new PrimeNumbers();
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  cout << pn->solve(n, a) << endl;
  delete pn;
  return 0;
}
