#include <bits/stdc++.h>
using namespace std;
bool d[1000001] = {false};
vector<int> pr;
void Sieve() {
  for (int i = 2; i <= 1000; ++i)
    if (d[i] == false)
      for (int j = i; j * j < 1000001; ++j) d[i * j] = true;
  for (int i = 2; i < 1000001; ++i)
    if (d[i] == false) pr.push_back(i);
}
bool checkPrime(int n) {
  if (n < 2) return false;
  if (n < 1000001) return (d[n] == false);
  for (int i = 0; pr[i] * pr[i] <= n; ++i)
    if (n % pr[i] == 0) return false;
  return true;
}
int main() {
  int n, x, res = 0;
  cin >> n;
  Sieve();
  for (int i = 0; i < n; ++i) {
    cin >> x;
    if (checkPrime(x)) res++;
  }
  cout << res << "\n";
  return 0;
}
