# include <iostream>
# include <stdint.h>
# include <stdio.h>
# include <math.h>
#include <cstdlib>
# include <algorithm>
# include <string>
using namespace std;
int main(){
    int n; cin >>n;
    long  x[n]={},sum =0;
    for(int i =0;i<n;i++){
        cin >>x[i];
        if(x[i] ==2) sum++;
        else{
            for(int j=2;j<x[i];j++){
                if(x[i]%j ==0) break;
                if(j==x[i]-1) sum++;
            }
        }
    }
    cout <<sum<<"\n";
	return 0;
}

