#78 素数

from math import sqrt

n = int(input())

ans = 0

for i in range(n):
    x = int(input())
    a = 1
    for z in range(2, int(sqrt(x))+1):
        if x % z == 0:
            a = 0
            break
    ans += a
print(ans)
