import math
n = int(input())
ans = 0
for i in range(n):
    x = int(input())
    p = 1
    for z in range(2, int(math.sqrt(x))+1):
        if x % z == 0:
            p = 0
            break
    ans += p
print(ans)
