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 <= 10000; i = i + 2)
        {
        	bool is_prime = true;
        	foreach(var p in prime)
        	{
        		if(i % p == 0)
        		{
        			is_prime = false;
        			break;
        		}
        	}
            if (is_prime) { 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());
            bool is_prime = true;
            foreach(var p in prime)
            {
            	if(test % p == 0)
            	{
            		is_prime = false;
            		break;
            	}
            }
            if(is_prime){ ans++; }
        }
        Console.WriteLine(ans);
	}
}