#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e8 + 8;
int a[1000 + 8];
int n, v, j;
void insertSort(int a[]) {
  for (int i = 1; i < n; ++i) {
    v = a[i];
    j = i - 1;
    while (j >= 0 && a[j] > v) {
      a[j + 1] = a[j];
      j--;
    }
    a[j + 1] = v;
  }
}
bool judge(int x) {
  if (x == 2) return true;
  if (x < 2) return false;
  for (int i = 2; i <= (int)sqrt(x); ++i) {
    if (x % i == 0) return false;
  }
  return true;
}
int main() {
  memset(a, 0, sizeof a);
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  insertSort(a);
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    if (judge(a[i])) cnt++;
  }
  printf("%d\n", cnt);
  return 0;
}
