import math

def is_prime(n):
    sqrtn = math.ceil(math.sqrt(n))
    for i in range(2, sqrtn + 1):
        if n % i == 0:
            return False
    return n != 1

n = int(input())
answer = 0
for _ in range(0, n+1):
    m = int(input())
    if is_prime(m):
        print(m)
        answer = answer + 1
print(answer)
