#include <bits/stdc++.h>
int main() {
  int i, j = 0, c = 0, n, A[10000], flag, tmp;
  scanf("%d", &n);
  if (n > 10000 || n <= 0) exit(8);
  for (i = 0; i < n; i++) {
    scanf("%d", &A[i]);
  }
  while (j < n) {
    flag = 0;
    for (i = 2; i < A[j]; ++i) {
      if (A[j] % i == 0) {
        flag = 1;
      }
    }
    if (flag == 0) c++;
    j++;
  }
  printf("%d\n", c);
}
