using System;
public class Eratosthenes
{
	public static void Main(string[] args)
	{
		int count = int.Parse(Console.ReadLine());
		int sum = 0;//?´???°???????¨?
		
		for (int i = 0; i < count; i++) {	
			//?????????????±????????????????
			int target = int.Parse(Console.ReadLine());
			//????????????
			if (target >= 2 && target % 2 != 0) {
				
				int j = 3;
					do{
					
				
					if (target == 2 || target == 3||target==5||target==7) {//?´???°??§??????
						sum += 1;
						break;
					}
			
					if (target % j == 0) {//?´???°??§?????????
						break;
					}
					if ((j + 2) > target / (j+2))
				   {
						//????????????????????§????????????break?????????????????´????????????????????\???
						sum += 1;
						break;
					}
					
					j+=2;
				}while(j<=target/j);
			}
				
		}
			
		Console.WriteLine(sum);
	}
}