using System;
using System.Collections.Generic;

namespace ALDS1_1_C
{
    class Program
    {
        static SortedSet<int> primes = new SortedSet<int>();
        static int tmpMax = 1;
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            primes.Add(2);
            tmpMax = 2;
            int cnt = 0;
            while (n-- != 0)
            {
                var x = int.Parse(Console.ReadLine());
                if (x < tmpMax)
                {
                    if (primes.Contains(x)) cnt++;
                    else continue;
                } 
                var sqrt = (int)Math.Sqrt(x);
                bool isPrime = true;
                foreach (var p in primes)
                {
                    if (p > sqrt) break;
                    if (x % p == 0)
                    {
                        isPrime = false;
                        break;
                    }
                }
                for(int i=primes.Max+1;i<=sqrt; i++)
                {
                    if(x % i == 0)
                    {
                        isPrime = false;
                        break;
                    }
                }
                if (isPrime) cnt++;
            }
            Console.WriteLine(cnt);
        }
    }
}