
import math

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

print(c)

