N = int(input())
a = []

count = 0
for i in range(N):
    x=int(input())
    if x == 2:
        count+=1
    else:
        print(x)
        if pow(2, x-1,x ) == 1:
            count+=1

print(count)

