#include <bits/stdc++.h>
using namespace std;
bool prime[100000000];
void isPrime(void) {
  fill(prime, prime + 100000000, true);
  prime[0] = prime[1] = false;
  for (int i = 0; i * i < 100000000; i++) {
    if (prime[i]) {
      for (int j = 2 * i; j < 100000000; j += i) {
        prime[j] = false;
      }
    }
  }
}
int main(void) {
  isPrime();
  int n, N, cnt = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> N;
    if (prime[N]) cnt++;
  }
  cout << cnt << endl;
  return 0;
}
