/*
 * Problem: Prime Numbers
 * Author: Khan
 * Date: 11th October, 2017
 */
#include <stdio.h>

int cnt = 0;

int isPrime(int n)
{
    if(x < 2)
        return 0;
    else if(x == 2)
        return 1;
    if(x % 2 == 0)
        return 0;
    for (int i = 0; i * i <= x; i += 2)
    {
        if(x % i == 0)
            return 0;
    }
    return 1;
}

int main(int argc, char const *argv[])
{
    freopen("sample.txt", "r", stdin);
    int N, a;
    scanf("%d", &N);
    for (int i = 0; i < N; ++i)
    {
        scanf("%d", &a);
        if(isPrime(a))
            cnt++;
    }
    printf("%d\n", cnt);
    return 0;
}