#include <bits/stdc++.h>
unsigned prime[10000000 + 2];
void create_prime(void) {
  unsigned i, j;
  unsigned size;
  unsigned sq_num = (int)sqrt((double)10000000);
  memset((char*)prime, 0xFF, sizeof(prime));
  prime[0] = 0;
  prime[1] = 0;
  for (i = 2; i <= sq_num; i++) {
    if (prime[i] != 0) {
      for (j = 2; i * j <= 10000000; j++) {
        prime[i * j] = 0;
      }
    }
  }
}
int main(void) {
  int i, n, value;
  int count = 0;
  create_prime();
  scanf("%d\n", &n);
  for (i = 0; i < n; i++) {
    scanf("%d\n", &value);
    if (prime[value] != 0) {
      count++;
    }
  }
  printf("%d\n", count);
  return 0;
}
