#include <iostream>
#include <cmath>

using namespace std;

int main(){
 int n,i,p,d,j,N=0;
 cin >> n;
 for (i=0;i<n;++i) {
   cin >> p;
   d=sqrt(p);
   for (j=2;j<d+1;++j) {
     if (p%j==0) {
       N++;
       break;
     }
   }
 }
 cout << (n-N) << endl;
 return 0;
}

