#include <bits/stdc++.h>
#define CONST 1000000

using namespace std;

long long a[CONST];
bool b[CONST]={true};

ifstream fi ("demnt.inp");
ofstream fo ("demnt.out");

int main(){
   b[0]=false;b[1]=false;
   int i;
   for (i=2;i<=CONST;i++){
    if (b[i]==true){
        for (int k=i*2;k<=CONST;k+=i){b[k]=false;}
    }
   }
   int n;
   fi>>n;
   int a[n],num=0;
   for (i=0;i<n;i++){fi>>a[i];
      if (b[a[i]]==true){num++;}
   }
   fo<<num;
}
