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