using System;
using System.Collections.Generic;

class Program
{
	static private List<int> PrimeList;

	static private int Max()
	{
		return PrimeList[PrimeList.Count-1];
	}

	static private bool Prime(int n)
	{
		if(n == 1) return false;

		int SqrtN = Math.Sqrt(n) + 1;
		foreach(int p in PrimeList)
		{
			if(p > SqrtN) break;
			if(n%p == 0) return false;
		}

		bool a = true;
		int max = Max();
		if(max < SqrtN)
		{
			for(int i=max+2; i<SqrtN; i+=2)
			{
				bool isprime = true;
				foreach(int p in PrimeList)
				{
					if(i%p == 0)
					{
						isprime = false;
						break;
					}
				}
				if(isprime)
				{
					PrimeList.Add(i);
					if(n%i == 0)
					{
						a = false;
						break;
					}
				}
			}
		}
		return a;
	}

	static void Main() 
	{
		PrimeList = new List<int>();
		PrimeList.Add(2);
		PrimeList.Add(3);
		int num = int.Parse(Console.ReadLine());

		int n = 0;
		for(int i=0; i<num; i++)
		{
			if(Prime(int.Parse(Console.ReadLine()))) n++;
		}
		Console.WriteLine(n.ToString());
	}
}