#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> prime_number;
  int n;
  cin >> n;
  int a[10500];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n, greater<int>());
  prime_number.push_back(2);
  for (int i = 3; i <= a[0]; i++) {
    int ope = 0;
    for (int j = 0; j < prime_number.size(); j++) {
      if (prime_number[j] * prime_number[j] > i) break;
      if (i % prime_number[j] == 0) {
        ope = 1;
        break;
      }
    }
    if (ope == 0) prime_number.push_back(i);
  }
  int ans = 0;
  int i = 0, j = 0;
  sort(a, a + n);
  while (i < n && j < prime_number.size()) {
    if (a[i] == prime_number[j]) {
      ans++;
      i++;
      j++;
    } else if (a[i] < prime_number[j])
      i++;
    else if (a[i] > prime_number[j])
      j++;
  }
  cout << ans << endl;
  return 0;
}
