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

class Program
{
    public void Proc()
    {
        int itemCount = int.Parse(Console.ReadLine());
        int[] numList = new int[itemCount];
        int max = int.MinValue;
        for(int i=0; i<itemCount; i++)
        {
            int num = int.Parse(Console.ReadLine());
            numList[i] = num;
            max = Math.Max(max, num);
        }
        List<int> sosu = GetSosuList(max);
        int sosuCount = 0;
        foreach(int num in numList)
        {
            if(sosu.Contains(num))
            {
                sosuCount++;
            }
        }
        Console.WriteLine(sosuCount);
    }

    private List<int> GetSosuList(int max)
    {
        List<int> tmp = new List<int>();
        List<int> sosu = new List<int>();
        for(int i=2; i<=max; i++)
        {
            if(!tmp.Contains(i))
            {
                sosu.Add(i);
                int mul = 2;
                int num = mul * i;
                while (num <= max)
                {
                    tmp.Add(num);
                    mul++;
                    num = mul * i;
                }
            }
        }
        return sosu;
    }

    static void Main(string[] args)

    {

        Program prg = new Program();
        prg.Proc();

    }
}