#include <bits/stdc++.h>
using namespace std;
bool isPrime(int n) {
  if (n == 1) return false;
  int q = (int)sqrt(n);
  for (int i = 2; i <= q; ++i) {
    if (n % i == 0) return false;
  }
  return true;
}
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    int num;
    int cnt = 0;
    while (n--) {
      scanf("%d", &num);
      if (isPrime(num)) ++cnt;
    }
    printf("%d\n", cnt);
  }
  return 0;
}
