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