#include <bits/stdc++.h>
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> an(n);
  for(int i=0; i<n; ++i) cin >> an[i];
  sort(an.begin(),an.end());
  int ans = 0;
  vector<bool> ansis(1000001,true);
  for(int i=0; i<n; ++i){
    if(ansis[an[i]]) ++ans;
    else continue;
    for(int j= an[i]; j<=1000000; j += an[i]){
      ansis[j] = false;
    }
    if(i<n-1 && an[i] == an[i+1]) --ans;
  }
  cout << ans << endl;
}