import std.stdio;
import std.conv;
import std.algorithm;
import std.range;
import std.string;
import std.typecons;
import std.math;
import std.random;
import std.range;
void main()
{
    auto a = readln().strip.split(" ").map!(to!int);
    auto c = 0;
    foreach (i; iota(a[0]))
    {
        auto k = readln.strip.to!int;
        if (k == 2)
        {
            c++;
            continue;
        }
        if (k < 2)
            continue;
        if (k % 2 == 0)
            continue;
        for (auto j = 3; j ^^ 2 <= k; j += 2)
        {
            if (k % j == 0)
                goto break_;
        }
        c++;
        break_:
    }
    writeln(c);
}
