def P(n):
    for i in range(2,n):
        if i*i>n:
            return True
        if n%i==0:
            return False
    return True

n=int(input())
count=0
for i in range(n):
    x = int(input())
    count+=P(x)
print(count)

