#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int numberOfPrimeNumber = N;
  for (int i = 0; i < N; i++) {
    int primeNumber;
    cin >> primeNumber;
    if (primeNumber == 2) {
    } else if (primeNumber % 2 == 0) {
      numberOfPrimeNumber--;
    }
    for (int j = 3; j < sqrt(primeNumber); j++) {
      if (primeNumber % j == 0) {
        numberOfPrimeNumber--;
      }
    }
  }
  cout << numberOfPrimeNumber << endl;
  return 0;
}
