#include <bits/stdc++.h>
int main() {
  int num;
  int i, j;
  int *array;
  int count = 0;
  do {
    scanf("%d", &num);
  } while (num < 1 || num > 10000);
  array = (int *)malloc(sizeof(int) * num);
  count = num;
  for (i = 0; i < num; i++) {
    do {
      scanf("%d", &array[i]);
    } while (array[i] < 2 || array[i] > 100000000);
  }
  for (i = 0; i < num; i++) {
    for (j = 2; j < sqrt((double)array[i]); j++) {
      if (array[i] % j == 0) {
        count--;
        break;
      }
    }
  }
  printf("%d\n", count);
  free(array);
  return 0;
}
