using System;

namespace ALDS1
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = 0;
            int n = getint();
            for (int i = 0; i < n; i++)
            {
                int m = 0;
                int x = getint();
                if (x == 2) count++;
                else if (x % 2 == 1)
                {
                    for (int j = 3; j < x; j += 2)
                    {
                        if (x % j == 0)
                        {
                            m = 1;
                            break;

                        }
                    }
                    if (m == 0) count++;
                }
                
            }
            Console.WriteLine(count);
           
        }
        static int getint()
        {
            int x = int.Parse(Console.ReadLine());
            return x;
        }
    }
}