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

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            string input=Console.ReadLine();
            int n = int.Parse(input);
            int[] result=new int[n];
            int count;
            int count2;
            count2=0;
           
            for (int i = 0; i < n; i++)
            {
                string a=Console.ReadLine();
                int b = int.Parse(a);
                count = 0;

                for (int j = 1; j < b+1; j++)
                {
                    if (b%j==0)
                    {
                        count = count + 1;  
                    }
                }
                if (count == 2)
                {
                    count2 = count2 + 1;
                    result[count2] = b;
                }

            }

            Console.WriteLine(count2);
            Console.ReadLine();
        }
    }
}