#include <bits/stdc++.h>
char isPrime[(int)1e8 + 5];
void solver() {
  isPrime[0] = isPrime[1] = 0;
  for (int i = 2; i < (int)1e8 + 5; ++i) {
    isPrime[i] = 1;
  }
  for (int i = 2; i < (int)1e8 + 5; ++i) {
    if (isPrime[i] == 1) {
      for (int j = 2 * i; j < (int)1e8 + 5; j += i) {
        isPrime[j] = 0;
      }
    }
  }
  int N;
  int tmp;
  int sum = 0;
  scanf("%d", &N);
  for (int i = 0; i < N; ++i) {
    scanf("%d", &tmp);
    if (isPrime[tmp] == 1) {
      sum++;
      ;
    }
  }
  printf("%d\n", sum);
}
int main() {
  solver();
  return 0;
}
