#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <stdbool.h>
typedef long long LL;
typedef long double Lf;
#define Rep(i,a,n)for(int i=(int)(a);i<(int)(n);i++)
#define rep(i,n)Rep(i,0,n)
#define Ma(x,y) ((x)>(y)?(x):(y))
#define mi(x,y) ((x)<(y)?(x):(y))
#define N 1001
#define MOD 1000000007
int acs(const void* a, const void* b) { return *(int*)a - *(int*)b; }//1,2,3,4
int des(const void* a, const void* b) { return *(int*)b - *(int*)a; }//9,8,7,6
int cmp_char(const void* a, const void* b) { return *(char*)a - *(char*)b; }//a,b,c,d
int cmp_str(const void* a, const void* b) { return strcmp(*(const char**)a, *(const char**)b); }//aaa,aab
//temmie_のsnippet

typedef struct FG {
	int n, a, cou;
}F;

int fact(const int n, F* a) {
	long long x, i, j, c = 0;
	x = n;
	for (i = 2; i * i <= x; i++) {
		for (j = 1; x % i == 0; j++)x /= i;
		if (j > 1) { a[c].n = i; a[c].a = j - 1; c++; }
	}
	if (x - 1) { a[c].n = x; a[c].a = 1; c++; }
	a[0].cou=c;
	return 0;
}

int main() {
	int n,a[N],ans=0;
	scanf("%d",&n);
	if(n==1){printf("1");return 0;}
	rep(i,n)scanf("%d",&a[i]);
	qsort(a, n, sizeof(int), acs);
	int v[N] = { 0 };
	rep(i,n-1)if(a[i]==a[i+1]){v[i]++;v[i+1]++;}
	rep(i,n)if(v[i]){a[i]=0;}
	F f[N][15];
	rep(i,n)rep(j,14){f[i][j].a=0;f[i][j].n=0;f[i][j].cou=0;}
	rep(i,n)fact(a[i],f[i]);
	int q[N];
	rep(i,N)q[i]=2*N;
	rep(i, n){
		rep(j, f[i][0].cou) {
			q[f[i][j].n]=mi(q[f[i][j].n],f[i][j].a);
		}
	}
	rep(i, n){
		if (!a[i])continue;
		int flag=0;
		rep(j,f[i][0].cou){
			if(f[i][j].a<=q[f[i][j].n])flag++;
		}
		if (flag==0||flag==f[i][0].cou)ans++;
	}
	//rep(i, n) { rep(j,f[i][0].cou)printf("%d,%d ",f[i][j].n,f[i][j].a);printf("\n");}
	
	printf("%d", ans);
	return 0;
}