#include <bits/stdc++.h>
using namespace std;
void eratos(bool p[]) {
  for (int i = 1; i < 100000001; ++i) {
    p[i] = true;
  }
  for (int i = 2; i * i < 100000001; ++i) {
    for (int j = 2; i * j < 100000001; ++j) {
      p[i * j] = false;
    }
  }
}
int main() {
  int n, sum = 0;
  bool p[100000001];
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  eratos(p);
  for (int i = 0; i < n; ++i) {
    if (p[arr[i]] == true) ++sum;
  }
  cout << sum << endl;
  return 0;
}
