N = int(input())

def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

total = 0
for i in range(N):
    n = int(input())
    if is_prime(n):
        total +=1
print(total)
