#include <bits/stdc++.h>
int prime(int);
int main() {
  int n, num[10000], i, j, flag = 0, count = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &num[i]);
  }
  for (i = 0; i < n; i++) {
    if (prime(num[i]) == 0) count++;
  }
  printf("%d\n", count);
  return 0;
}
int prime(int num) {
  int i = 3;
  if (num == 2) return 0;
  if (num < 2 && num % 2 == 0) return -1;
  while (i <= sqrt((double)num)) {
    if (num % i == 0) return -1;
    i = i + 2;
  }
  return 0;
}
