int Primejudgment(int m[], int loop);

int main()
{
	int n,r[10000],i,j=0,k=0,ans,count=0;

    scanf("%d",&n);
	for (i = 0;i < n;i++) scanf("%d", &r[i]);
	
	while (j < n) {

	ans= Primejudgment(r,j);
	if (ans == 1) count++;
	j++;
	ans = 0;

	}
	printf("%d",count);
    return 0;
}

int Primejudgment(int m[],int loop)
{
	int i;
	if (m[loop] < 2)
		return 0;
	else if (m[loop] == 2) {
	
		return 1;
	}

	if (m[loop] % 2 == 0)
		return 0;

	for (i = 3; i <= m[loop] / i; i += 2)
		if (m[loop] % i == 0)
			return 0;

	return 1;
}