#include <bits/stdc++.h>
int ifprime(int n);
int main() {
  int number;
  int readScan = scanf("%d", &number);
  int array[number];
  int count;
  count = 0;
  for (int i = 0; i < number; i++) {
    int readScan = scanf("%d", &array[i]);
    if (array[i] == 2 || array[i] == 3) count++;
    int prime;
    if (array[i] > 3) {
      if (ifprime(array[i]) == 1) count++;
    }
  }
  printf("%d", count);
  printf("\n");
  return (EXIT_SUCCESS);
}
int ifprime(int n) {
  int i;
  for (i = 2; i <= n / 2; i++) {
    if (n % i == 0) return 0;
  }
  return 1;
}
