#include<stdio.h>
int main(){
	int N, freq[1000010] = {};
	scanf("%d", &N);
	for(int i = 1; i <= N; i++){
		int temp;
		scanf("%d", &temp);
		freq[temp]++;
	}
	int ans = 0;
	for(int i = 1; i <= 1000000; i++){
		if(freq[i] == 0)
			continue;
		if(freq[i] == 1)
			ans++;
		for(int j = 2; j * i <= 1000000; j++)
				freq[j * i] = 0;
	}
	printf("%d", ans);
	return 0;
}