#include <iostream>
using namespace std;
int main(void)
{
	int n, ans = 0;
	cin >> n;
	for(int i = 0; i < n; i++){
		int a;
		bool prime = true;
		cin >> a;
		for(int k = 2; k * k <= a; k++) {
			if(a % k == 0){
				prime = false;
				break;
			}
		}
		if(prime) ans++;
	}
	cout << ans << endl;
	return 0;
}
