#include <bits/stdc++.h>
char s[100000001];
int main() {
  int t, i, j, k, p, count = 0;
  memset(s, 0, sizeof(s));
  for (i = 2; i <= 10000; i++) {
    if (!s[i]) {
      for (j = 2 * i; j <= 10000000; j += i) s[j] = 1;
    }
  }
  scanf("%d", &t);
  for (i = 0; i < t; i++) {
    scanf("%d", &p);
    if (s[p] == 0) count++, s[p] = 1;
  }
  printf("%d\n", count);
}
