#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, max, cnt = 0;
  cin >> n;
  int internum[n];
  for (int i = 0; i < n; i++) {
    cin >> internum[i];
    if (i == 0) {
      max = internum[i];
    } else {
      if (internum[i] > max) max = internum[i];
    }
  }
  int primenum[max + 1];
  for (int i = 0; i < max + 1; i++) {
    primenum[i] = 1;
    if (i % 2 == 0) {
      primenum[i] = 0;
    }
  }
  primenum[1] = 0;
  primenum[2] = 1;
  for (int i = 3; i < max / 2; i += 2) {
    for (int j = i; j < max + 1; j += i) {
      for (int k = 3; k < max + 1; k++) {
        if (k % i == 0) {
          primenum[k] = 0;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (primenum[internum[i]] == 1) cnt++;
  }
  cout << cnt << endl;
}
