#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  int max = 0;
  vector<int> primes;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] > max) max = arr[i];
  }
  for (int i = 2; i <= max; i++) {
    bool prime = true;
    for (int j = 0; j < primes.size(); j++) {
      if (i % primes[j] == 0) {
        prime = false;
        break;
      }
    }
    if (!prime) continue;
    primes.push_back(i);
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < primes.size(); j++) {
      if (arr[i] == primes[j]) {
        ans++;
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
