#include <bits/stdc++.h>
using namespace std;
void read(int& size, int** ppArray);
void checkPrimeNumbers(size_t size, const int* pArray, int& count);
void write(const int count);
int main() {
  int size = 0, ret = 0;
  int* pArray = NULL;
  read(size, &pArray);
  checkPrimeNumbers(size, pArray, ret);
  write(ret);
  delete pArray;
}
void read(int& size, int** ppArray) {
  if (NULL == ppArray || NULL != *ppArray) return;
  cin >> size;
  if (10000 < size) return;
  *ppArray = new int[size];
  for (int i = 0; i < size; i++) {
    cin >> *(*ppArray + i);
  }
}
void checkPrimeNumbers(size_t size, const int* pArray, int& count) {
  if (NULL == pArray) return;
  for (int i = 0; i < size; i++) {
    int value = *(pArray + i);
    if (2 == value) {
      count++;
      continue;
    }
    if (0 == value % 2) continue;
    for (int j = 3; j <= value; j += 2) {
      if (value == j) {
        count++;
        break;
      }
      if (0 == value % j) break;
    }
  }
}
void write(const int count) { cout << count << endl; }
