#include <bits/stdc++.h>
int main() {
  int x[10000], N, i, j, num;
  scanf("%d", &N);
  if (N < 1 || N > 10000) {
    printf("Please type 1 to 10000.");
    exit(1);
  }
  num = N;
  for (i = 0; i < N; i++) {
    scanf("%d", &x[i]);
    if (x[i] > 100000000 || x[i] < 2) {
      printf("Please type 2 to 100000000.");
      exit(2);
    }
  }
  for (i = 0; i < N; i++) {
    for (j = 2; j <= (int)sqrt(x[i]); j++) {
      if (x[i] % j == 0) {
        num--;
        ;
      }
    }
  }
  printf("%d\n", num);
  return 0;
}
