using System;
using System.Collections.Generic;

class program
{
    public static void Main()
    {
        var N = int.Parse(Console.ReadLine());
        var elements = new List<long>();
        var max = (long)0;
        for (var i = 0; i < N; i++)
        {
            var num = long.Parse(Console.ReadLine());
            elements.Add(num);
            max = max > num ? max : num;
        }
        var count = 0; var prime = 2;
        while (true)
        {
            for (var i = 2; i <= prime; i++)
            {
                if (i == prime)
                {
                    if (elements.Contains(prime))
                    {
                        count++;
                    }
                }
                else if (prime % i == 0)
                {
                    break;
                }
            }
            if (prime == max)
            {
                break;
            }
            prime++;
        }
        Console.WriteLine(count);
    }
}