#include <bits/stdc++.h>
using namespace std;
int flag[10001] = {false};
void isPrime(int N) {
  for (int i = 2; i <= N; i++) {
    if (flag[i]) continue;
    for (int d = i * 2; d <= N; d += i) {
      flag[d] = true;
    }
  }
}
int main() {
  int N, ans = 0, tmp, maxi = 0;
  cin >> N;
  vector<int> vt;
  for (int i = 0; i < N; i++) {
    cin >> tmp;
    vt.push_back(tmp);
    maxi = max(maxi, tmp);
  }
  isPrime(maxi);
  for (int i = 0; i < vt.size(); i++) {
    if (!flag[vt[i]]) ans++;
  }
  cout << ans << endl;
  return 0;
}
