import math

n=int(input())
c=0
for j in range(n):
    x=int(input())
    if x<2: pass
    elif x==2 or x==3 or x==5 or x==7:
        c+=1
    for i in range(2,int(math.sqrt(x))+1):
        if x>i and x%i==0:
            break
        elif i==x and x%i==0:
            c+=1

print(c)

