#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, *k, n, c = 0, a;
  cin >> n;
  k = new int[n];
  for (i = 0; i < n; i++) {
    cin >> k[i];
  }
  for (i = 0; i < n; i++) {
    a = 0;
    for (j = 2; j <= k[i] / 2; j++) {
      if (k[i] % j == 0) a = 1;
      if (a == 1) break;
    }
    if (a == 0) c++;
  }
  cout << c << endl;
  return 0;
}
