// D - Not Divisible
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
#define rep(i,n) for(int i=0;i<(int)(n);++i)

int main(){
	int N; cin>>N;

	int mx = 0;
	map<int,int> m;
	rep(i, N){
		int a; cin>>a;
		m[a]++;
		mx = max(mx, a);
	}

	int ans = 0;
	vi l(mx+1, 0);
	for(auto x:m){
		int a, c; tie(a, c) = x;
		if(c == 1 && l[a] == 0) ans++;
		for(int i=a; i<=mx; i+=a) l[i] = 1;
	}
	cout<< ans <<endl;
}
