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