import math

n = int(input())
Numbers = [int(input()) for i in range(n)]

ans = 0
for i in Numbers:
    for j in range(2,int(math.sqrt(i))+1):
        if i%j==0:
            break
    else:
        ans += 1
print(ans)
