#include <bits/stdc++.h>
using namespace std;
bool isP[10001];
void make_table() {
  for (int i = 0; i < 10001; i++) isP[i] = true;
  isP[0] = isP[1] = false;
  for (int i = 2; i * i <= 10001; i++) {
    if (!isP[i]) continue;
    for (int j = i * i; j < 10001; j += i) {
      isP[j] = false;
    }
  }
}
int main() {
  make_table();
  int n, a, cnt = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    cnt += isP[a];
  }
  cout << cnt << endl;
}
