#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream i(s);
  i >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream o;
  o << x;
  return o.str();
}
template <class T>
void pv(T a, T b) {
  for (T it = a; it != b; ++it) cerr << *it << " ";
  cerr << endl;
}
const int INF = 1000000000;
const double PI = acos(-1.0), EPS = 1e-10;
const int M = 100000000;
bool isp[M + 1];
int main() {
  memset(isp, -1, sizeof isp);
  isp[0] = isp[1] = false;
  for (int i = 2; i * i <= M; i++)
    if (isp[i])
      for (int j = 2 * i; j <= M; j += i) isp[j] = false;
  int N;
  cin >> N;
  int cnt = 0;
  for (int i = 0; i < (int)N; ++i) {
    int p;
    cin >> p;
    if (isp[p]) cnt++;
  }
  cout << cnt << endl;
}
