N = int(input())
count = 0
for i in range(N):
    n = int(input())
    if (n != 2) * (n % 2 == 0):
        continue
    j = 3
    while j*j <= n:
        if n % j == 0:
            break
        j += 2
    if j*j > n:
        count += 1
print(count)
            
