prime = set([2])
for i in range(3, 10001, 2):
    if i not in prime:
        prime.add(i)
n = int(input())
cnt = 0
for i in (int(input()) for _ in range(n)):
    if i in prime:
        cnt += 1
print(cnt)
