#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e8 + 8;
int prime[maxn];
void Table() {
  memset(prime, 0, sizeof prime);
  for (int i = 2; i <= maxn; ++i) {
    if (!prime[i]) {
      for (int j = i + i; j <= maxn; j += i) {
        prime[j] = 1;
      }
    }
  }
}
int main() {
  int cnt = 0;
  Table();
  int n, x;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &x);
    if (!prime[x]) cnt++;
  }
  printf("%d\n", cnt);
  return 0;
}
