#include <bits/stdc++.h>
const int MAX_NUM = 10001;
class Sieve {
 public:
  Sieve() {
    for (auto& a : prime) a = true;
    prime[0] = prime[1] = false;
  }
  void erato() {
    for (int i = 2; i * i <= MAX_NUM; ++i)
      if (prime[i])
        for (int j = 2; i * j <= MAX_NUM; ++j) prime[i * j] = false;
  }
  bool isPrime(int x) { return prime[x]; }

 private:
  bool prime[MAX_NUM];
};
using namespace std;
int main() {
  Sieve SV;
  SV.erato();
  int N;
  cin >> N;
  int a = 0;
  for (int i = 0; i < N; ++i) {
    int x;
    cin >> x;
    a += SV.isPrime(x);
  }
  cout << a << endl;
}
