import math
n = int(input())
cnt = 0
for _ in range(n):
    x = int(input())
    if x == 2: cnt += 1
    if x < 2 or x%2 == 0: continue
    i = 3
    while i <= math.sqrt(x):
        if x%i == 0: break
        i += 2
    if not i <= math.sqrt(x): cnt += 1
print(cnt)

