#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
const long long int INF = (long long int)1e15;
struct PrimeList {
  PrimeList() { prime.clear(); };
  ~PrimeList(){};
  void init(int n) {
    std::vector<bool> isComposite(n + 1);
    for (int i = 2; i <= n; ++i) {
      if (isComposite[i]) continue;
      prime.push_back(i);
      for (int j = i; j <= n; j += i) {
        isComposite[j] = true;
      }
    }
  }
  std::vector<int> prime;
};
int A[10005];
int main() {
  int N;
  cin >> N;
  PrimeList p;
  int max = 0;
  for (long long int i = (long long int)(0); i < (long long int)(N); ++i) {
    cin >> A[i];
    max = std::max(max, A[i]);
  }
  p.init(max);
  sort(A, A + N);
  int sum = 0;
  int pi = 0;
  for (long long int i = (long long int)(0); i < (long long int)(N); ++i) {
    while (p.prime[pi] <= A[i] && p.prime.size() > pi) {
      if (p.prime[pi] == A[i]) {
        sum++;
        break;
      }
      pi++;
    }
  }
  cout << sum << endl;
  return 0;
}
