#include <bits/stdc++.h>
using namespace std;
int main() {
  int pri[100000001] = {};
  pri[2] = 1;
  int f = 0;
  for (int i = 3; i < 100000001; i++) {
    for (int j = 2; j * j <= i; j++) {
      if (i % j == 0) {
        f = 1;
        break;
      }
    }
    if (f == 0) pri[i] = 1;
  }
  int n;
  cin >> n;
  int co = 0;
  for (int i = 0; i < n; i++) {
    int nu;
    cin >> nu;
    if (pri[nu]) co++;
  }
  cout << co << endl;
  return 0;
}
