#include <bits/stdc++.h>
using namespace std;
bool sieve[100000001];
void makeSieve() {
  fill_n(sieve, 100000001, true);
  sieve[0] = sieve[1] = false;
  for (int i = 4; i < 10001; i += 2) {
    sieve[i] = false;
  }
  for (int i = 3; i < 101; i += 2) {
    if (!sieve[i]) continue;
    for (int j = i * i; j < 10001; j += i) {
      sieve[j] = false;
    }
  }
}
int main() {
  makeSieve();
  int n;
  cin >> n;
  int num = 0;
  while (n--) {
    int a;
    cin >> a;
    num += (int)sieve[a];
  }
  cout << num << endl;
  return 0;
}
