#include <bits/stdc++.h>
using namespace std;
void eratos(int p[], int n) {
  p[1] = 0;
  for (int i = 2; i <= n; i++) p[i] = 1;
  for (int i = 2; i <= n; i++) {
    if (p[i]) {
      for (int j = 2 * i; j <= n; j += i) {
        if (j % i == 0) p[i] = 0;
      }
    }
  }
}
int main(void) {
  int n, m, p[10001], ans = 0;
  cin >> n;
  eratos(p, n);
  for (int i = 0; i < n; i++) {
    cin >> m;
    if (p[m]) ans++;
  }
  cout << ans << endl;
  return 0;
}
