#include <iostream>

using namespace std;

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