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

namespace FindPrime
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int[] arr = new int[N];

            for (int l = 0; l < N; l++)
            {
                arr[l] = int.Parse(Console.ReadLine());
            }

            int count = 0;

            for(int i=0;i<arr.Length;i++)
            {
                bool prime = true;
                int half = (int) Math.Sqrt(arr[i]);
                for(int j = 2; j <= half; j++)
                {
                    if ((arr[i] % j) == 0)
                    {
                        prime = false;
                        break;
                    }
                }

                if (prime == true)
                {
                    count++;
                }
            }

            Console.WriteLine(count);
        }
    }
}