def isprime(x):
    if x == 2: return True
    if x % 2 == 0: return False
    for i in range(3, x, 2):
        if x % i == 0: return False
    return True

n = int(input())
count = 0
for i in range(n):
    x = int(input())
    if isprime(x): count += 1
print(count)