int main()
{
	int C[10000];
	
	int n;
	int i, j, k;
	int l = 1;

	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &C[i]);
	}
	int kosu = 0;
	for (int j = 0; j < n; j++)
	{
		if (C[j] == 2)
		{
			kosu = kosu++;
		}
		else
		{
			k = 0;
			for (int l =2; l < C[j]; l ++)
			{
				if (C[j] % l == 0)
				{
					k = 1;
					break;
				}
			}

			if (k == 0)
			{
				kosu++;
			}
		}
	}
		printf("%d\n", kosu);	

	}