import math

n=int(input())

cou=0

for i in range(n):
    a=int(input())
    jg=True
    z=int(math.sqrt(a))+1
    for k in range(2,z):
        if a%k==0:
            jg=False
            break
    if jg==True:
        cou+=1

print(cou)


