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