#include <stdio.h>
#include <math.h>

int prime_check(long x);

int main(void) {
    int N, i, count = 0;
    long x;
    scanf("%d", &N);
    for (i = 0; i < N; i++) {
        scanf("%d", &x);
        if(prime_check(x)) count++;
    }
    printf ("%d\n", count);
}

int prime_check(int x)
{
    int i;
    int root_x = (int)(sqrt(x));
    if (x == 2) return 1;
    if (x < 2 || x % 2 == 0) return 0;
    for (i = 2; i <= root_x; i++) {
        if (x % i == 0) return 0;
    }
    return 1;
}