#include <bits/stdc++.h>
int main(void) {
  int A[1000];
  int N, i, j, C, x;
  C = 0;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &A[i]);
    x = 0;
    for (j = 2; j <= sqrt(A[i]); j++) {
      if (A[i] % j == 0) x++;
    }
    if (x == 0) C++;
  }
  printf("%d\n", C);
  return 0;
}
