#include <bits/stdc++.h>
using namespace std;
int isPrime[1000000];
int main() {
  int num;
  int i, j, k;
  int count = 0;
  isPrime[0] = isPrime[1] = 0;
  for (i = 2; i < 1000000; ++i) {
    isPrime[i] = 1;
  }
  for (i = 2; i < 1000000; i++) {
    if (isPrime[i] == 1) {
      for (j = 2; i * j <= 1000000; ++j) {
        isPrime[i * j] = 0;
      }
    }
  }
  cin >> num;
  for (i = 0; i < num; ++i) {
    cin >> k;
    if (isPrime[k] == 1) {
      count++;
    }
  }
  cout << count << endl;
}
