using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Prime_Numbers
{
    class Program
    {
        static void Main(string[] args)
        {
            int num = int.Parse(Console.ReadLine());

          
            int nop = 0;

            for (int i = 0; i < num; i++)
            {
                int temp = int.Parse(Console.ReadLine());
                if (temp == 2)
                {
                    
                }
                else
                {
                    for (int j = 2; j < temp; j++)
                    {
                        if (temp % j == 0)
                        {
                            ++nop;
                            break;
                        }
                    }
                }
            }

            Console.WriteLine(num - nop);
        }
    }
}

