N=int(input())
count=0
for i in range(N):
    n=int(input())
    s=2
    for j in range(n):
        if (n==2):
            count+=1
            break
        tmp=n%s
        if (tmp!=0):
            s+=1
            if (s==n):
                count+=1
                break
        else:
            break
print(count)