import math

n = int(input())
res = 0

for _ in range(n):
    k = int(input())
    for j in range(2, int(math.sqrt(k)) + 1):
        if k % j == 0:
            break
    else:
        res += 1

print(res)
