#include <bits/stdc++.h>
int N;
int A[10000];
int NN = 0;
void insertion(int a[]);
int print(int d[], int c);
int main() {
  int i = 0;
  int ab, cd;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &A[i]);
  }
  insertion(A);
  printf("%d", NN);
  return 0;
}
void insertion(int a[]) {
  int v;
  int i;
  int j;
  int y = 0;
  for (i = 0; i < N; i++) {
  A:;
    if (a[i] == 2) printf("%d\n", a[i]);
    if (a[i] % 2 != 0) {
      for (j = 2; j <= a[i] - 1; j++) {
        if (a[i] % j == 0) goto A;
        if (j == a[i] - 1) {
          NN++;
        }
      }
    }
  }
}
