#include <iostream>
#include <cmath>
using namespace std;

int main ()
{
    int n, a, cnt = 0;
    cin >> n;
    while(n--)
    {
        cin >> a;
        int i = 2, rang = sqrt(a);
        while((a % i != 0) && (i <= rang)) i++;
        if (i > rang) cnt++;
    }
    cout << cnt << endl;
    return 0;
}
