from math import sqrt
def isprime(inlst, i, sq):
    inlst = [x for x in inlst if x%i > 0 or x == i]
    if sq >= i:
        return isprime(inlst, i +2, sq)
    else:
        return inlst
 
n = int(input())
inlst = []
for i in range(n):
    inlst.append(int(input()))
inlst = [x for x in inlst if x%2 > 0 or x == 2]
i = 3
maxin = max(inlst)
if len(inlst) > 0:
    inlst = isprime(inlst, i, int(sqrt(maxin)) + 1)
print(len(inlst))