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) {
				
				for (int j = 3; j <= target / j; j += 2) {
				
					if (target == 2 || target == j) {//?´???°??§??????
						sum += 1;
						break;
					}
			
					if (target % j == 0) {//?´???°??§?????????
						break;
					}
					if ((j + 2) >= target / j)
 {					//????????????????????§????????????break?????????????????´????????????????????\???
						sum += 1;
						break;
					}
								
				}
			}
				
		}
			
		Console.WriteLine(sum);
	}
}