#include"stdafx.h"

int isprime(int x) {
    if (x == 2)
    return 1;

    if (x < 2 || x % 2 == 0)
    return 0;

    int i = 3;
    while (i*i <= x) {
    if (x%i == 0)
    return 0;
    i = i + 2;
    } 
    return 1;
}


int main()
{
    int x, box[10000],  n, k, ans = 0, m=0;

    scanf("%d", &n);
    for (k = 0; k < n; k++)
        scanf("%d", &box[k]);

    for (x = 0; x < n; x++) {
        ans = isprime(box[x]);

            if (ans == 1)
            m++;

    ans = 0;
}
    
    printf("%d\n", m);
    return 0;
}