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