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