#include <bits/stdc++.h>
using namespace std;
int counter = 0;
void isPrime(int num) {
  int i = 2;
  while (1) {
    if (num % i == 0) break;
    i++;
  }
  if (i == num) counter++;
  return;
}
int main() {
  int N;
  cin >> N;
  int num;
  for (int i = 0; i < N; i++) {
    cin >> num;
    isPrime(num);
  }
  cout << counter << endl;
}
