using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

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

            for (int i = 0; i < n; i++)
            {
                string a = Console.ReadLine();
                b[i] = int.Parse(a);
            }

            int[] d = new int[b.Max()+1];
            int c = (int)Math.Sqrt(b.Max());

            for (int i = 2; i <= c; i++)
            {
                if (d[i] == 0)
                {
                    for (int j = 2; i * j < b.Max(); j++)
                    {
                        d[i * j] = 1;
                    }
                }
            }

            for (int i = 0; i < n; i++)
            {
                if (d[b[i]] == 0)
                {
                    count = count + 1;
                }
            }

            Console.WriteLine(count);
            Console.ReadLine();
        }
    }
}