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