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;
            if ((a[i] % 2 == 0 && a[i] != 2) || (a[i] % 3 == 0 && a[i] != 3) || (a[i] % 5 == 0 && a[i] != 5) || 
                (a[i] % 7 == 0 && a[i] != 7) || (a[i] % 11 == 0 && a[i] != 11))
                continue;
            else
            {
                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);
    }
}