#include <bits/stdc++.h>
using namespace std;
bool isPrime[100000001];
void make_isPrime(int MAX) {
  for (int i = 0; i < MAX; i++) isPrime[i] = true;
  isPrime[0] = isPrime[1] = false;
  for (int i = 2; i < MAX; i++) {
    if (isPrime[i])
      for (int j = 2; i * j <= MAX; j++) isPrime[i * j] = false;
  }
}
int main() {
  make_isPrime(100000001);
  int n;
  cin >> n;
  vector<int> input;
  for (int i = 0; i < n; i++) {
    int tmp;
    cin >> tmp;
    input.push_back(tmp);
  }
  int ans = 0;
  for (int i = 0; i < input.size(); i++) {
    if (isPrime[input[i]]) ans++;
  }
  cout << ans << "\n";
}
