#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;
    for (int j = 2; j < primeNumber; j++) {
      if (primeNumber % j == 0) {
        numberOfPrimeNumber--;
        break;
      }
    }
  }
  cout << numberOfPrimeNumber << endl;
  return 0;
}
