using System;

class Prime_Numbers
{
    public static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int cnt = 0;

        for (int i = 0; i < n; i++)
        {
            int number = int.Parse(Console.ReadLine());

            for (int j = 2; j <= number; j++)
            {
                if (number % j != 0 && number != j)
                {
                    cnt++;
                    break;
                }
            }

            if (number == 2) cnt++;
        }

        Console.WriteLine(cnt);


    }
}