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