n=int(input())
a=[0]*n
count=0
for i in range(0,n):
    flag=1
    a[i]=int(input())
    for j in range(2,a[i]):
        if a[i]%j==0:
            flag=0
    if flag==1:
        count+=1
print(count)

