n=int(input())
nums=[]
for i in range(n):
    nums.append(int(input()))
count=0
for i in range(n):
    for j in range(2,int(sqrt(nums[i])+1)):
        if nums[i]%j==0:
            break
    count+=1
print(count)
