#include <iostream>
using namespace std;

int main()
{
	unsigned int  n,j;
	cin >> n;
	unsigned  int num,count = 0;
	for(int i = 0; i < n; i++)
	{
		cin >> num;
		for(j = 2; j <=num; j++)
		{
			if((num % j) == 0)
			{
				break;
			}
		}
		if(j == num) count++;
	}
	cout << count << endl;
	return 0;
}