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