#include <bits/stdc++.h>
int isPrime(int n);
int main(void) {
  int i, n, x, num = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x);
    isPrime(x);
    if (isPrime(x) == 1) num++;
  }
}
int isPrime(int x) {
  int i;
  if (x == 2) return 1;
  if (x < 2 || x % 2 == 0) return 0;
  i = 3;
  while (i <= (double)sqrt(x)) {
    if (x % i == 0) return 0;
    i = i + 2;
    return 1;
  }
}
