#include <bits/stdc++.h>
using namespace std;
int isPrime(long long N) {
  int i;
  if (N < 2) return 0;
  if (N == 2)
    return 1;
  else if (N % 2 == 0)
    return 0;
  for (i = 3; i * i < N; i += 2) {
    if (N % i == 0) return 0;
  }
  return 1;
}
int main() {
  long long x, N, In;
  long long count = 0;
  cin >> N;
  for (x = 0; x < N; x++) {
    cin >> In;
    if (isPrime(In)) count++;
  }
  cout << count << endl;
  return 0;
}
