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