def function(a):
    for j in range(2,a):
        if a%j==0:
            return 1
        if j**2>a:
            break
    return 0
n=int(input())
s=0
for i in range(n):
    a=int(input())
    s+=function(a)
print(n-s)
