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