#include <bits/stdc++.h>
int calc(int);
int main() {
  int i, n, *num;
  int count = 0;
  scanf("%d", &n);
  num = (int *)malloc(sizeof(int) * n);
  for (i = 0; i < n; i++) {
    scanf("%d", &num[i]);
  }
  for (i = 0; i < n; i++) {
    if (calc(num[i])) count++;
  }
  printf("%d\n", count);
  free(num);
  return 0;
}
int calc(int num) {
  int i;
  if (num == 2) return 1;
  if (num % 2 == 0) return 0;
  for (i = 3; i < num; i += 2) {
    if (num % i == 0) return 0;
  }
  return 1;
}
