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

class AOJ
{
	public static void Main()
	{
        var prime = new List<int>(2);
        for (int i = 3; i <= 100000000; i = i + 2)
        {
            if (prime.Count(x => i % x == 0) > 0) { continue; }
            else { prime.Add(i); }
        }

        int count = int.Parse(Console.ReadLine().Trim());
        int ans = 0;
        for (int i = 0; i < count; i++)
        {
            int test = int.Parse(Console.ReadLine().Trim());
            if (prime.Contains(test)) { ans++; }
        }
        Console.WriteLine(ans);
	}
}