#include <bits/stdc++.h>
void print(std::vector<int>& values) {
  for (int x : values) {
    std::cout << x << " ";
  }
  std::cout << std::endl;
}
int main() {
  std::vector<int> items(0);
  int number;
  std::cin >> number;
  for (int i = 0; i < number; i++) {
    int x;
    std::cin >> x;
    items.push_back(x);
  }
  int max = *max_element(items.begin(), items.end());
  std::vector<int> numbers(0);
  for (int i = 2; i <= max; i++) {
    numbers.push_back(i);
  }
  int pivot = 2;
  while (pivot <= sqrt(max)) {
    auto itr = numbers.begin() + pivot - 1;
    while (itr != numbers.end()) {
      if ((*itr) % pivot != 0) {
        itr++;
      } else {
        numbers.erase(itr);
      }
    }
    pivot++;
  }
  int count = 0;
  for (int x : items) {
    for (int i = 0; i < numbers.size(); i++) {
      if (numbers[i] == x) {
        count++;
      }
    }
  }
  std::cout << count << std::endl;
  return 0;
}
