#include <bits/stdc++.h>
using namespace std;
bool IsPrime(int x) {
  int i, j = 2;
  for (i = 2; i <= x; i++) {
    if ((x % i) == 0) break;
    j++;
  }
  if (j == x)
    return true;
  else
    return false;
}
int main(void) {
  int p, n, COUNT = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> p;
    if (IsPrime(p)) COUNT++;
  }
  cout << COUNT << endl;
  return 0;
}
