#include <iostream>using namespace std;
// エラトステネスの篩//
 bool primes[100000000] = {true};bool IsPrime(int n) {  
int count = 0;  
for(int i=1;i<=n;i++){      
if(n % i == 0) {       
   count++;      }    
  if(count > 2){       
   return false;    
  } 
 } 
 return (count == 2);}int main(void){   
 int count = 0;  
  int n;  
  cin >> n;   
 for(int i = 0; i < n; i++) {    
    int p;       
 cin >> p;        
if(IsPrime(p)) {    
        count++;    
    }   
 }   
 cout << count << endl; 
   return 0;
