#include <bits/stdc++.h>
int judgement(int);
int main() {
  int n, a[10000], i, c = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < n; i++) {
    c = c + judgement(a[i]);
  }
  printf("%d\n", c);
  return 0;
}
int judgement(int an) {
  int j;
  if (an == 2) return 1;
  if (an & 2 == 0) return 0;
  for (j = 3; j < an; j++) {
    if (an % j == 0) return 0;
  }
  return 1;
}
