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


//?´???°?????°??????????????°??????
//??¨?????????????????????????????¨??????
int IsPrimeNumber(int num){

	int count = 0;
	//?´???°????????????num?????§????¢??????§??????
	//??????30?????§????´???°?????°????????????1*30???2*15???3*10???5*6??¨??°??????????????¨??????
	//5????¶???????????????§????????\???????´???°?????¢?????§???????????¨??????????????????????????§???
	//???30?????§????´???°??????????????????????????°????????\???????´???°?????§?????????
	//???30?????§????´???°???4?????????????????\???????´???°???4??????????????¨????????????

	if (num == 2 || num == 3){ return 1; }
	else if (num < 2 || num % 2 == 0 || num % 3 == 0){ return 0; }
	else{
	
		for (int n = 5; n < sqrt(num); n++){
			if (num%n == 0)return 0;
		}
		return 1;
	}

}


int main(){

	int n,num,count=0;
	cin >> n;

	for (int j = 0; j < n; j++){
		cin >> num;
		if (IsPrimeNumber(num) == 1)count++;
		
	}cout << count << endl;

	return 0;
}