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