using System;

namespace Sample
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int count = 0;
            int p;
            while (n-- > 0)
            {
                p = int.Parse(Console.ReadLine());
                if (p == 2) { count++; continue; }
                for(int i = 2; i * i <= p; i++)
                {
                    if (p % i == 0) continue;
                }
                count++;
            }
            Console.WriteLine(count);
        }
    }
}