#include <stdio.h>

int main()
{
    int total = 0;
    int n;
    scanf("%d", &n);
    int a[n];
    int pre;
    for (pre = 0; pre < n; pre++)
    {
        scanf("%d", &a[pre]);
    }
    for (pre = 0; pre < n; pre++)
    {
        if (hantei(a[pre]) == 1)
        {
            total += 1;
        }
    }
    printf("%d\n", total);
    return 0;
}

int hantei(int get)
{
    if (get == 1)
        return 1;
    if (get % 2 == 0)
        return 1;
    double sq = pow(get, 0.5);
    int pre;
    for (pre = 3; pre < sq; pre += 2)
    {
        if (get % (int)sq == 0)
            return 1;
    }
    return 0;
}
