#include <iostream>
#include <cmath>
using namespace std;

bool isPrime(int a){
	int x = (int)sqrt(a);
	int val = 1;
	for (int i = 2; i <= x; i++) val *= (a % i != 0);
	return (val == 1);
}

int main(){
	int n, count, a;
	cin >> n;
	count = 0;
	for (int i = 0; i != n; i++){
		cin >> a;
		count += isPrime(a);
	}
	cout << count << endl;
}
