#include <bits/stdc++.h>
using namespace std;
void fnPrimeNumber(const vector<int> &argviNum, int &argiPrimeCnt) {
  for (int i = 0; i < argviNum.size(); i++) {
    double dSqrt = sqrt((double)argviNum[i]);
    int iMaxDivisor = (int)dSqrt;
    bool bPrime = true;
    for (int iDivisor = 2; iDivisor <= iMaxDivisor; iDivisor++) {
      if (argviNum[i] % iDivisor == 0) bPrime = false;
      break;
    }
    if (bPrime) argiPrimeCnt++;
  }
}
int main() {
  vector<int> viNum;
  int iMaxSize;
  int iPrimeCnt = 0;
  cin >> iMaxSize;
  for (int i = 0; i < iMaxSize; i++) {
    int iNum;
    cin >> iNum;
    viNum.push_back(iNum);
  }
  fnPrimeNumber(viNum, iPrimeCnt);
  cout << iPrimeCnt << endl;
  return 0;
}
