#include <bits/stdc++.h>
using namespace std;
vector<bool> isPrime(long long int n) {
  vector<bool> p(n + 1, true);
  for (int i = 2; i < n; i++) {
    if (!p[i]) continue;
    for (int j = i * 2; j <= sqrt(n); j += i) {
      p[j] = false;
    }
  }
  return p;
}
int main(void) {
  int n;
  cin >> n;
  vector<bool> p = isPrime(10000);
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    int tmp;
    cin >> tmp;
    cnt += p[tmp];
  }
  cout << cnt << endl;
  return 0;
}
