N = int(input())

cnt = 0
for _ in range(N):
    n = int(input())
    if n!=2 and n%2 == 0:
        cnt += 1
        continue
    i = 3
    while i**2 <= n:
        if n%i == 0:
            cnt += 1
            break
        i += 2

print(N-cnt)

