#include<iostream>
using namespace std;
bool sosuu(long int y)
{
	for (long int n = 3; n < sqrt(y); n += 2)
	{
		if (y%n == 0)
			return false;
	}
	return true;
}
int main()
{
	long int x,ans = 0;
	while (cin>>x)
	{
		if (sosuu(x) == true)
			ans++;
	}
	printf("%d", ans);
}