#include <bits/stdc++.h>
int hantei(int);
int main() {
  int n, i, count = 0;
  int s[10000];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &s[i]);
    if (hantei(s[i]) == 1) {
      count++;
    }
  }
  printf("%d\n", count);
}
int hantei(int x) {
  int i = 3;
  if (x == 2) return 1;
  if (x < 2 || x % 2 == 0) return 0;
  while (i <= sqrt(x)) {
    if (x % i == 0) return 0;
    i += 2;
  }
  return 1;
}
