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


namespace StartFinish
{
    class Program
    {
     
        static void Main(string[] args)
        {
            // int[] xy = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int n = int.Parse(Console.ReadLine());
            int count = 0;
            for (int i = 0; i < n; i++)
            {
                int seisuu = int.Parse(Console.ReadLine());
                bool isSosuu = true;
                for (int j = 2; j <= seisuu / 2; j++)
                {
                    if (seisuu % j == 0)
                    {
                        isSosuu = false;
                    }
                }
                if (isSosuu)
                {
                    count++;
                }
            }
            Console.WriteLine(count);
        }
    }
}