s=[2]
a=[int(i) for i in range(2,100000000) if pow(2 ,int(i)-1, int(i)) ==1]

while a!=[]:
    t=a[0]
    a=[i for i in a if i % t !=0]
    s.append(t)
 
n=int(input())
x=0
for i  in range(n):
    if int(input()) in s:
        x+=1
print(x)
 