#include <bits/stdc++.h>
void print(std::vector<int>& values) {
  for (int x : values) {
    std::cout << x << " ";
  }
  std::cout << std::endl;
}
std::vector<int> Sieve(int n) {
  std::vector<int> items(0);
  for (int i = 2; i <= n; i++) {
    items.push_back(i);
  }
  int pivot = 2;
  while (pivot <= sqrt(n)) {
    for (int i = pivot + 1; i <= n; i++) {
      int judge;
      if (std::find(items.begin(), items.end(), i) == items.end()) {
        judge = 0;
      } else {
        judge = 1;
      }
      if ((i % pivot == 0) and (judge == 1)) {
        items.erase(std::find(items.begin(), items.end(), i));
      }
    }
    pivot++;
  }
  return items;
}
int main() {
  int n;
  std::vector<int> items(0);
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    std::cin >> x;
    items.push_back(x);
  }
  int max = *max_element(items.begin(), items.end());
  std::vector<int> judge = Sieve(max);
  int count = 0;
  for (int x : judge) {
    for (int y : items) {
      if (x == y) {
        count++;
      }
    }
  }
  std::cout << count << std::endl;
  return 0;
}
