#include <stdio.h>
#include <iostream>
using namespace std;

int countPrimeNumbers(int nums[], int n);

int main(void)
{
	int n, nums[10000];
	cin >> n;
	
	for (int i = 0; i < n; i++) {
		cin >> nums[i];
	}
	
	int count = countPrimeNumbers(nums, n);
	
	cout << count << endl;
	
	return 0;
}

int countPrimeNumbers(int nums[], int n)
{
	int count = 0;
	
	for (int i = 0; i < n; i++) {
		for (j = 2; j * j <= nums[i]; j++) {
			if (nums[i] % j == 0) break;
		}
		if (j * j > nums[i]) count++;
	}
	
	return count;
}