import math
n=int(input())
s=0
for i in range(n):
    x=int(input())
    a=0
    if x==2:
        s+=1
    else:
        for j in range(2,int(math.sqrt(x))+1):
            if x%j==0:
                a+=1
                break
        if a==0:
            s+=1
print(s)
