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