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