import math

cnt = 0
n = int(input())

for i in range(n):
    x = int(input())
    if x == 2: cnt += 1
    elif x % 2 != 0:
        rx = int(math.sqrt(x))
        for i in range(3, rx):
            if x % i == 0: break
        cnt += 1

print(cnt)
