#include<iostream>
using namespace std;

void inputData(int R[], int *N)
{
	cin >> *N;
	for (int i = 0; i < *N; i++)
	{
		cin >> R[i];
	}
}

bool isPrimeNumber(int in)
{
	if (in == 2) return true;
	if (in % 2 == 0) return false;
	int s = (int)sqrt((double)in);

	for (int i = 3; i < s; i=i+2)
	{
		if ((in % i) == 0)
		{
			return false;
		}
	}
	return true;
}

static const int MAX = 10000;

int main()
{
	int R[MAX];
	int N;
	int count = 0;
	inputData(R, &N);
	for (int i = 0; i < N; i++)
	{
		if (isPrimeNumber(R[i]))
		{
			count++;
		}
	}
	cout << count << endl;
	return 0;
}