#include <bits/stdc++.h>
using namespace std;
bool notPrime[100000005] = {};
void calcPrimes(int n) {
  int sqrtn = static_cast<int>(sqrt(n));
  notPrime[1] = true;
  for (int i = 2; i <= sqrtn; ++i) {
    if (notPrime[i]) continue;
    for (int j = i * i; j <= n; j += i) notPrime[j] = true;
  }
}
int main() {
  int N = 0;
  cin >> N;
  vector<int> nums(N);
  for (auto& num : nums) cin >> num;
  int numMax = 0;
  numMax = *max_element(nums.begin(), nums.end());
  calcPrimes(numMax);
  int counter = 0;
  for (auto& num : nums) {
    if (!notPrime[num]) ++counter;
  }
  cout << counter << endl;
  return 0;
}
