#define		_CRT_SECURE_NO_WARNINGS
#include	<cstdio>
#include	<cstdint>
#include	<iostream>
#include	<unordered_set>
#include	<deque>

typedef		std::uint_least32_t		ULI;		//10^9
typedef		std::int_least32_t		SLI;
typedef		std::uint_least64_t		ULLI;
typedef		std::int_least64_t		SLLI;

using namespace std;

int main()
{
	deque<int>				dq{ 2, 3 };
	unordered_set<int>		us{ 2, 3 };

	for (int i = 5; i < 10'000; i += 2)
	{
		bool	isPrime = true;

		for (auto it : dq)
		{
			if (i % it == 0)
			{
				isPrime = false;
				break;
			}

			if (it * it > i)
			{
				break;
			}
		}

		if (isPrime)
		{
			dq.push_back(i);
			us.insert(i);
		}
	}

	int		n;
	cin >> n;
	cin.clear();
	cin.ignore();
	int		sum = 0;

	for (int i = 0; i < n; i++)
	{
		int		v;
		cin >> v;

		if (us.find(v) != end(us))
		{
			sum++;
		}
	}

	cout << sum << "\n";

	return 0;
}