using System;
using System.Collections.Generic;
class Program
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int[] nArray = new int[n];
        int i = 0;
        int j = 0;
        for (i = 0; i < n; i++)
        {
            nArray[i] = int.Parse(Console.ReadLine());
        }

        List<int> prime = new List<int>();
        int current = 0;
        for (current = 10000; current > 1; current--)
        {
            for(i = current; i > 1; i--)
            {
                if ((current % i == 0 || current % 2 == 0) && current != 2 && current != i)
                    break;
                else if (i == 2 && current % i != 0)
                    prime.Add(current);
                else if (current == 2 && i == 2)
                    prime.Add(current);
            }   
        }

        int count = 0;
        for(i = 0;i < nArray.Length; i++)
        {
            for(j = 0;j < prime.Count; j++)
            {
                if (nArray[i] == prime[j])
                    count++;
            }
        }

        Console.WriteLine(count);
        
    }
}