#include <bits/stdc++.h>
using namespace std;
bool check_natural(int num) {
  if (num <= 1) {
    return false;
  }
  if (num == 2) {
    return true;
  }
  if (num % 2 == 0) {
    return false;
  }
  int i = 3;
  while (i < sqrt(num)) {
    if (num % i == 0) {
      return false;
    }
    i++;
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  std::vector<int> nums;
  for (size_t i = 0; i < n; i++) {
    int num;
    cin >> num;
    nums.push_back(num);
  }
  int natural_count = 0;
  for (int num : nums) {
    if (check_natural(num)) {
      natural_count++;
    }
  }
  std::cout << natural_count << '\n';
  return 0;
}
