#include <bits/stdc++.h>
int main() {
  int N, i, j, num = 0, r = 1;
  scanf("%d", &N);
  int A[N];
  for (i = 0; i < N; i++) {
    scanf("%d", &A[i]);
  }
  for (i = 0; i < N; i++) {
    for (j = 2; j < A[i]; j++) {
      r = (A[i] % j);
      if (r == 0) break;
    }
    if (r == 0) continue;
    if (r != 0) num++;
  }
  printf("%d\n", num);
  return 0;
}
