import math
N = int(input())
ans = 0

for i in range(N):
    num = int(input())
    rt = math.ceil(math.sqrt(num))
    div = 2
    while (rt > div):
        if num % div:
            div += 1
        else:
            break
    if div == rt:
        ans += 1
print(ans)

