from math import sqrt
s = int(input())
ct = 0
for i in range(s):
    ok = 1
    x = int(input())
    for z in range(2, int(sqrt(x))+1):
        if x % z == 0:
            ok = 0
            break
    ct += ok
print(ct)
