#include <bits/stdc++.h>
bool prime[100000000];
void createprime() {
  int i, j;
  unsigned int sq_num = (unsigned int)sqrt((double)100000000);
  for (i = 0; i < 100000000 + 1; i++) {
    prime[i] = true;
  }
  prime[0] = false;
  prime[1] = false;
  for (i = 2; i <= sq_num; i++) {
    if (prime[i] == true) {
      for (j = 2; (i * j) <= 100000000; j++) {
        prime[i * j] = false;
      }
    }
  }
}
int main() {
  int i, n, value;
  int count = 0;
  createprime();
  scanf("%d\n", &n);
  for (i = 0; i < n; i++) {
    scanf("%d\n", &value);
    if (prime[value]) {
      count++;
    }
  }
  printf("%d\n", count);
  return 0;
}
