using System;

namespace ALDS1_1_C
{
    class Program
    {
        static void Main(string[] args)
        {
            int element = int.Parse(Console.ReadLine());
            int[] input = new int[element];
            int count = 0;

            for (int i=0; i<element; i++)
            {
                input[i] = int.Parse(Console.ReadLine());
                int num = judge(input[i]);

                if (num == 1) count++;
            }

            Console.WriteLine(count);
        }

        static int judge(int a)
        {
            int div = 1;
            bool check = false;
            
            for (int i=2; i<a; i++)
            {
                div = a % i;

                if (div == 0)
                {
                    check = true;
                    break;
                }
            }

            if(check == true)
            {
                return 0;
            }
            else
            {
                return 1;
            }
        }
    }
}