#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
const double EPS = 1e-10;
const double PI = acos(-1.0);
bool isP(int n) {
  if (n == 1) return false;
  if (n == 2 || n == 3) return true;
  if (n % 2 == 0) return false;
  if (n % 3 == 0) return false;
  for (auto i = 3; i < sqrt(n); i += 2)
    if (n % i == 0) return false;
  return true;
}
int main() {
  int n, t, count = 0;
  cin >> n;
  for (int i = (0); i < (n); ++i) {
    cin >> t;
    if (isP(t)) count++;
  }
  cout << count << endl;
  return 0;
}
