using System;

namespace ALDS1_1_C
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            int n = int.Parse(str);
            int[] A = new int[n];
            for (int i = 0; i < n; ++i)
            {
                string str1 = Console.ReadLine();
                A[i] = int.Parse(str1);

            }

            bool[] prime = new bool[100000001];
            prime[0] = false;
            prime[1] = false;
            for(int i = 2;i<100000001;++i)
            {
                prime[i] = true;
            }
            
            for(int i=2;i<100000001;++i)
            {
                if (prime[i])
                {
                    int notPrimeNum = i * 2;
                    while (notPrimeNum < 100000001)
                    {
                        prime[notPrimeNum] = false;
                        notPrimeNum += i;
                    }
                }
            }

            int Ans = 0;
            for (int i = 0; i < n; ++i)
            {
                if (prime[A[i]])
                {
                    Ans += 1;
                }
            }

            Console.WriteLine("{0}", Ans);
            string pause = Console.ReadLine();

        }
    }
}