n=int(input())
c=0
for j in range(n):
    x=int(input())
    for i in range(2,x+1):
        if x>i and x%i==0:
            break
        elif i==x and x%i==0:
            c+=1
            break

print(c)

