<?php

function isPrime($num, $n) {
    for ($i = 0; $i < $n; $i++) {
        if ($num == 2) {
            return true;
        } elseif ( $num < 2 or $num % 2 == 0) {
            return false;
        } else {
            $start = 3;
            while ($start <= sqrt($num) + 1) {
                if ($num % $start == 0) {
                    return false;
                }
                $start += 2;
            }
            return true;
        }
    }
}

$n = trim(fgets(STDIN));
$count = 0;

for ($i = 0; $i < $n; $i++) {
    $number = fgets(STDIN);
    if (isPrime($number, $n)) $count++;
}

echo $count . PHP_EOL;

