using System;

public class Hello{
    public static void Main(){
        
        int line = int.Parse (Console.ReadLine());
        
        int count = 0;
        for (int i = 0; i < line; ++i){
            
            int num = int.Parse (Console.ReadLine());
            if (isPrime(num)){
                
                count++;
            }
        }
        
        Console.WriteLine (count);
    }
    
    public static bool isPrime (int num){
        
        	int k=0;
        	
        	if (num <= 2){return true;}

		for(int j=2;j<num;j++)
		{
			if(num%j==0)
			{
				k=1;
				break;
			}
		}

		if(k==0){
		  //   Console.WriteLine (num + "isPrime");
		    return true;
		}else{
		    return false;
		}
    }
}