#include <iostream>
using namespace std;

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C

int main() {
	int n;
	cin >> n;
	int arr[n];
	int max = 0;
	int res[n] = {0};
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
		if (arr[i] > max) max = arr[i];
	}
	
	for (int i = 2; i <= max; i++) {
		bool prime = true;
		for (int j = i == 2 ? 3 : 2; j <= i - 1; j++) {
			if (i % j == 0) {
				prime = false;
				break;
			}
		}
		if (!prime) continue;
		
		for (int j = 0; j < n; j++) {
			if (arr[j] == i) res[j] += 1;
		}
	}
	
	int ans = 0;
	for (int i = 0; i < n; i++) {
		if (res[i] > 0) ans++;
	}
	cout << ans << endl;
	return 0;
}