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