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