using System;
using System.Collections.Generic;
using System.Linq;

namespace AizuOnLine_Lesson
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> data = Program.GetData();

            int maxNum = data.Max();
            List<int> primeNumber = Program.GetPrimeNumber(maxNum);

            int count = 0;
            foreach (int num in data)
            {
                if (primeNumber.Any(p => p == num))
                {
                    count++;
                }
            }

            Console.WriteLine(count);
        }

        private static List<int> GetPrimeNumber(int num)
        {
            var primeNumber = Enumerable.Range(2, num - 1).ToList<int>();
            int sqrtNum = (int)Math.Sqrt(num);
            List<int> testNumber = Enumerable.Range(2, sqrtNum - 1).ToList<int>();

            while (0 < testNumber.Count())
            {
                int val = (int)testNumber[0];

                primeNumber.RemoveAll((p) => { return (p != val) && (p % val == 0); });

                testNumber.RemoveAll((t) => { return t % val == 0; });
            }

            return primeNumber.ToList<int>();
        }

        private static List<int> GetData()
        {


            List<int> data = new List<int>();

            int count = Convert.ToInt32(Console.ReadLine());

            for (int i = 0; i < count; i++)
            {
                data.Add(Convert.ToInt32(Console.ReadLine()));
            }

            return data;
        }
    }
}