#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef vector <int> IVEC;

int seive(IVEC &A, int n){
	IVEC num(n+1,1);
	num[0]=0, num[1]=0;
	int count=1, limit=int(sqrt(n));
	for (int i=3; i<=n; i+=2)
		if (num[i]){
			count++;
			if (i<=limit)
				for (int j=3*i; j<=n; j+=2*i) num[j]=0;
		}

	A.resize(count);
	A[0] = 2;
	int j=1;
	for (int i=3; i<=n; i+=2)
		if (num[i]==1) A[j++]=i;
	return 0;
}

int main(void){
	IVEC primes, nums;
	int n;

	cin>>n;
	nums.resize(n);
	for (int i=0; i<n; i++)
		cin>>nums[i];
	sort(nums.begin(),nums.end());

	int max_num=nums[nums.size()-1];
	seive(primes, max_num);

	for (int i=0; i<(int)primes.size(); i++)
		for (int j=0; j<(int)nums.size(); j++)
			if ((nums[j] >= pow(primes[i],2)) &&  (nums[j] % primes[i] == 0))
				nums[j]=0;

	int count=0;
	for (int i=0; i<(int)nums.size(); i++)
		if (nums[i]) count++;

	cout<<count<<endl;
	return 0;
}