#include <bits/stdc++.h>
using namespace std;
bool isPrime(int x);
int main() {
  int n;
  cin >> n;
  vector<int> nums;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    nums.push_back(x);
  }
  int count = 0;
  for (int i = 0; i < n; ++i) {
    if (isPrime(nums[i])) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
bool isPrime(int x) {
  if (x == 2) {
    return true;
  }
  if (x < 2 || x % 2 == 0) {
    return false;
  }
  long power = 1;
  for (int i = 0; i < (x - 1); ++i) {
    power *= 2;
  }
  if (power % x == 1) {
    return true;
  } else {
    return false;
  }
}
