using System;

namespace ALDS1_1_A
{
    class Program
    {
        static void Main(string[] args)
        {
            // C
            var line = System.Console.ReadLine();
            var N = System.Int32.Parse(line);
            var num = 0;
            var counter = 0;
            for (var i = 0; i < N; i++) {
                num = System.Int32.Parse(System.Console.ReadLine());

                if (num <= 3)
                {
                    counter++;
                    continue;
                }
                if (num % 2 == 0) continue;
                else
                {
                    if (CheckNum(num))
                    {
                        counter++;
                    }
                }
            }
            System.Console.WriteLine(counter);

        }

        static bool CheckNum(int num) {
            for (var i = 3; i < num/2; i+=2) { 
                if (num % i == 0) return false;
            }
            return true;
        }
}}