n=int(input())

A=[0 for i in range(n)]

for i in range(n):
    A[i]=int(input())

x=0

for j in range(2,n+1):
    k=0
    for j in range(2,j):
        if A[j]%j==0:
            k=k+1
    if k==0:
        x=x+1
print(x)

