n = int(input())
A = []
for _ in range(n):
    A.append(int(input()))

p = 0
for a in A:
    if a == 2:
        p += 1
    for i in range(1, a//2+1):
        if a%i == 0:
            p += 1
            break

print(p)