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