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