#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = MOD + 1;
const long double EPS = 1e-12;
template <class T>
T &chmin(T &a, const T &b) {
  return a = min(a, b);
}
template <class T>
T &chmax(T &a, const T &b) {
  return a = max(a, b);
}
const int N = 111111111;
bool prime[N + 1];
set<int> primes;
void hurui() {
  memset(prime, true, sizeof(prime));
  prime[0] = prime[1] = false;
  for (int i = 2; i * i < N; i++) {
    if (!prime[i]) continue;
    for (int j = i; i * j < N; j++) {
      prime[i * j] = false;
    }
  }
}
const int dx[] = {-1, 0, 0, 1}, dy[] = {0, -1, 1, 0};
bool valid(int x, int y, int h, int w) {
  return (x >= 0 && y >= 0 && x < h && y < w);
}
int place(int x, int y, int w) { return w * x + y; }
int main() {
  hurui();
  int cnt = 0;
  int n;
  cin >> n;
  for (int i = (0); i < (int)(n); i++) {
    int t;
    cin >> t;
    if (prime[t]) cnt++;
  }
  cout << cnt << endl;
  return 0;
}
