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