int sosu(int n,int D[])
{
	int i, j, k;
	int l = 1;
	D[0] = 2;
	for (i = 3; i <= n; i += 2)
	{
		k = 0;
		for (j = 3; j <= sqrt(i); j += 2)
		{
			if (i%j == 0)
			{
				k = 1;
				break;
			}
		}

		if (k == 0)
		{
			//printf("%d ", i);
			D[l] = i;
			l = l + 1;
		}
	}
	l = l - 1;
	//printf("total %d", l);
	//printf("\n");

	return l;
}


int main()
{
	int C[10000];
	int D[10000];
	int n;
	int comp = 0;
	//printf_s("??\???????????°????????° ");
	scanf(" %d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &C[i]);
		if (comp < C[i]) {
			comp = C[i];
		}
	}
	int k = sosu(comp, D);
	int kosu = 0;
	//for (int i = 0; i <= k; i++)
	//{
	//	printf_s("%d %d\n", i, D[i]);
	//}


	for (int j = 0; j <= k; j++)
	{
		for (int i = 0; i < n; i++)
		{
		if ((C[i] % D[j]) == 0)
			{
			//printf_s("%d ", D[j]);
				kosu++;
				break;
			}

	}
		
}
		printf("%d\n", kosu);	

	
    
}