#include <iostream>

using namespace std;

int main(){

    int n;
    cin >> n;
    int ans =0;
    for(int i=0;i<n;i++){
        int m;
        cin >> m;
        int j;
        ans++;
        for(j=2;j*j<=m;j++){
            if(m%j==0){ans--;break;}
        }
    }
    cout << ans << endl;
    return 0;
}