#include <iostream>
using namespace std;
int main() {
int nn, n, d, sol = 0, nrdiv;
cin >> nn;
for (int i = 0 ; i < nn; i++) {
cin >> n;
nrdiv = 0;
for (d = 2; d * d <= n; d++) {
if (n % d == 0 && nrdiv == 0) {
n = n / d;
nrdiv++;
}
if (n == d)
nrdiv++;
}
for (d = 2; d * d <= n; d++) {
if (n % d == 0 && nrdiv == 1 )
nrdiv++;
}
if (nrdiv == 1)
sol++;
}
cout << sol;
return 0;
}