using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
 
class Program{
    static void Main(){
        int n = int.Parse(Console.ReadLine());
        int cnt = 0;
        for (int i = 0; i < n; i++)
        {
            int num = int.Parse(Console.ReadLine());
            for (int j = 2; j <= num; j++)
            {
                if(j == num) cnt++;
                else if(num % j == 0) break;
            }
        }
        Console.WriteLine(cnt);
    }
}