#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long int ll;

int main()
{
    int n;
	int x;
	int ans=0;
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> x;
		for(int i=2;i*i<=x;i++){
			if(x%i==0)goto next;
		}
		ans++;
		next:;
	}
	cout << ans << "\n";
    return 0;
}