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