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