#include<bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin >> n;
    int a[n];
    int count=0;
    for(int i=0;i<n;i++){
        cin >> a[i];
        for(int j=2;j<=sqrt(a[i]);j++){
            if(a[i]%j==0){
                count++;
                break;
            }
        }
    }
    cout << n-count << endl;
}
