#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j;
  int n;
  int A[10000];
  int res = 0;
  vector<int> P;
  vector<int>::iterator it;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", A + i);
  }
  sort(A, A + n);
  P.push_back(2);
  j = 3;
  for (i = 0; i < n; i++) {
    for (; j <= A[i]; j++) {
      it = P.begin();
      while (true) {
        if (j % (*it) == 0) {
          break;
        }
        if (++it == P.end()) {
          P.push_back(j);
          break;
        }
      }
    }
    it = P.begin();
    while (true) {
      if (A[i] % (*it) == 0 && (*it) != A[i]) {
        break;
      }
      if (++it == P.end()) {
        res++;
        P.push_back(A[i]);
        j = A[i] + 1;
        break;
      }
    }
  }
  printf("%d\n", res);
  return 0;
}
