#include <bits/stdc++.h>
bool p[100000000] = {0};
void prime() {
  for (int i = 2; i <= 100000000; i++) {
    if (p[i] == 0) {
      for (int j = 2; i * j <= 100000000; j++) {
        p[i * j] = 1;
      }
    }
  }
}
int main() {
  prime();
  int count = 0;
  int n_line;
  scanf("%d", &n_line);
  for (int i = 0; i < n_line; i++) {
    int n;
    scanf("%d", &n);
    if (p[n] == 0) {
      count++;
    }
  }
  printf("%d\n", count);
  return 0;
}
