import math
def isprime(n):
    check = 1
    if n == 1:
        check = 0
    else:
        m = int(math.sqrt(n)) + 1
        nums = [i for i in range(2, n)]
        while nums[0] <= m:
            p = nums[0]
            for j in range(1, int(n / p) + 1):
                nums.remove(p * j)
            if n not in nums:
                check = 0
                break
            else:
                pass
    return check
    
n = int(input())
ans = 0
for k in range(n):
    a = int(input())
    ans += isprime(a)
    
print(ans)
