using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;

class Program
{
	static void Main(string[] args)
	{


		int n = int.Parse(Console.ReadLine());
		int cnt = 0;

		for (int i = 0; i < n; i++)
		{


			int num = int.Parse(Console.ReadLine());
			int rt = (int)Math.Sqrt(num);

			for (int j = 2; j <= rt; j++)
			{
				if (n % j != 0)
				{
					break;
				}
                cnt++;
                break;
			}
		}

        Console.WriteLine("{0}",cnt);

	

		return;
		//Console.WriteLine("");

	}
}