#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
	int n, ans=0;
	vector<int> num(10000);
	
	//input
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> num[i];
	}

	vector<int> pm(1);
	pm[0] = 2;
	
	for (int j = 3; j <= 100000; j++) {
		for (int k = 0; k < pm.size(); k++) {
			if (j%pm[k] == 0) break;
			if (k == pm.size() - 1 && j%pm[k] != 0) {
				pm.push_back(j);
				//if (pm.size() % 100 == 0) {
				//	cout << "素数を見つけました : " << j << endl;
				//}
			}
		}
	}
	
	//cout << pm[pm.size() - 1] << endl;

	for (int i = 0; i < n;i++) {
		for (int j = 0; j < pm.size(); j++) {
			if (num[i] % pm[j] == 0) {
				if (num[i] == pm[j]) {
					ans++;
					//cout << "ans++_1 : " << num[i] << endl;
				}
				break;
			}
		}
	}

	cout << ans << endl;

	return 0;
}
