#include <iostream>
using namespace std;

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