#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; }
bool fld[1200][1200] = {};
int ind[1200][1200];
pair<int, int> hs[1111111];
void init() {
  for (int i = (0); i < (int)(1200); i++)
    for (int j = (0); j < (int)(1200); j++) ind[i][j] = INF;
  hurui();
  int p = 1, x = 600, y = 600;
  for (int i = (1); i < (int)(11111111); i++) {
    if (i % 2) {
      for (int j = (0); j < (int)(i); j++) {
        ind[x][y] = p;
        hs[p] = pair<int, int>(x, y);
        if (primes.count(p)) fld[x][y] = true;
        p++;
        y++;
      }
      for (int j = (0); j < (int)(i); j++) {
        ind[x][y] = p;
        hs[p] = pair<int, int>(x, y);
        if (primes.count(p)) fld[x][y] = true;
        p++;
        x--;
      }
    } else {
      for (int j = (0); j < (int)(i); j++) {
        ind[x][y] = p;
        hs[p] = pair<int, int>(x, y);
        if (primes.count(p)) fld[x][y] = true;
        p++;
        y--;
      }
      for (int j = (0); j < (int)(i); j++) {
        ind[x][y] = p;
        hs[p] = pair<int, int>(x, y);
        if (primes.count(p)) fld[x][y] = true;
        p++;
        x++;
      }
    }
    if (p > 1000000) break;
  }
}
pair<int, int> dp[1200][1200];
int n, m;
pair<int, int> solve(int x, int y) {
  if (dp[x][y] != pair<int, int>(-1, -1)) return dp[x][y];
  pair<int, int> res(0, -1);
  for (int i = (-1); i < (int)(2); i++) {
    int nx = x + 1, ny = y + i;
    if (ind[nx][ny] > m) continue;
    pair<int, int> next = solve(nx, ny);
    if (fld[nx][ny]) {
      if (next.first == 0)
        chmax(res, pair<int, int>(next.first + 1, ind[nx][ny]));
      else
        chmax(res, pair<int, int>(next.first + 1, next.second));
    } else
      chmax(res, next);
  }
  return dp[x][y] = res;
}
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;
}
