#include <bits/stdc++.h>
int IsPrime(int a) {
  if (a == 2) return 1;
  int k = 0;
  for (k = 2; k < a; k++) {
    if (a % k == 0) return 0;
  }
  return 1;
}
int main() {
  int N;
  int counter = 0;
  scanf("%d", &N);
  int arr[N];
  int i = 0;
  for (i = 0; i < N; i++) {
    scanf("%d", &arr[i]);
    if ((IsPrime(arr[i])) == 1) counter = counter + 1;
  }
  printf("%d\n", counter);
  return 0;
}
