#include <bits/stdc++.h>
using namespace std;
void insertion_sort(int *, int);
void make_prime(int, vector<int> &);
int main(int argc, char const *argv[]) {
  int n, count = 0;
  cin >> n;
  int input_array[n];
  vector<int> prime;
  for (int i = 0; i < n; ++i) {
    cin >> input_array[i];
  }
  insertion_sort(input_array, n);
  make_prime(input_array[n - 1], prime);
  for (int i = 0; i < prime.size(); ++i) {
    for (int j = i; j < n; ++j) {
      if (prime.at(i) == input_array[j]) {
        count++;
      }
    }
  }
  printf("%d\n", count);
  return 0;
}
void insertion_sort(int *x, int n) {
  int key = 0, j = 0;
  for (int i = 1; i < n; ++i) {
    key = x[i];
    j = i - 1;
    while (j >= 0 && x[j] > key) {
      x[j + 1] = x[j];
      j--;
    }
    x[j + 1] = key;
  }
}
void make_prime(int max, vector<int> &prime) {
  vector<int> v;
  for (int i = 2; i <= max; i++) {
    v.push_back(i);
  }
  for (int i = 0; i < v.size(); ++i) {
    for (int j = i + 1; j < v.size(); ++j) {
      if (v.at(j) % v.at(i) == 0) v.erase(v.begin() + j);
    }
  }
  for (int i = 0; i < v.size(); i++) {
    prime.push_back(v.at(i));
  }
}
