using System;

class Program
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int[] a = new int[n];
        for (int i = 0; i < a.Length; i++)
        {
            a[i] = int.Parse(Console.ReadLine());
        }

        int count = 0;
        for(int i = 0;i < a.Length; i++)
        {
            int dcount = 0;
            for (int j = a[i];j > 1; j--)
            {
                if (a[i] % j == 0)
                    dcount++;
                if (dcount > 1)
                    break;
            }
            if (dcount == 1)
                count++;
        }
        Console.WriteLine(count);
    }
}