#include<iostream>
using namespace std;

int main(){
	bool* isPrime = new bool[50000000];
	isPrime[0] = true;
	isPrime[1] = true;
	for(int i = 2; i < 50000000; i++){
		if(!isPrime[i]){
			for(int j = i * 2; j < 50000000; j+= i){
				isPrime[j] = true;
			}
		}
	}
	int n;
	cin >> n;
	int count = 0;
	for(int i = 0; i < n; i++){
		int x;
		cin >> x;
		if(x < 50000000){
			if(!isPrime[x]){
				count++;
			}
		}else{
			bool out = false;
			for(int j = 0; j < 50000000; j++){
				if(!isPrime[j]){
					if(x % j == 0){
						out = true;
						break;
					}
				}
			}
			if(!out){
				count++;
			}
		}
	}
	cout << count << endl;#include<iostream>
using namespace std;

int main(){
	long int limit = 60000000;
	bool* isPrime = new bool[limit];
	isPrime[0] = true;
	isPrime[1] = true;
	for(int i = 2; i < limit; i++){
		if(!isPrime[i]){
			for(int j = i * 2; j < limit; j+= i){
				isPrime[j] = true;
			}
		}
	}
	int n;
	cin >> n;
	int count = 0;
	for(int i = 0; i < n; i++){
		int x;
		cin >> x;
		if(x < limit){
			if(!isPrime[x]){
				count++;
			}
		}else{
			bool out = false;
			for(int j = 0; j < limit; j++){
				if(!isPrime[j]){
					if(x % j == 0){
						out = true;
						break;
					}
				}
			}
			if(!out){
				count++;
			}
		}
	}
	cout << count << endl;
	delete[] isPrime;
	return 0;
}
	delete[] isPrime;
	return 0;
}