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;
		if(PrimeList.Contains(n)) return true;

		bool a = true;
		foreach(int p in PrimeList)
		{
			if(p > n/2) break;
			if(n%p == 0)
			{
				a = false;
				break;
			}
		}
		if(a == false) return a;

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

	static void Main() 
	{
		PrimeList = new List<int>();
		PrimeList.Add(2);
		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());
	}
}