import math
def prime2(x):
    if x == 2: return True
    else:
        for s in stock:
            if x % s == 0: return False
        for j in xrange(3,int(math.sqrt(x))+1,2):
            if x % j == 0: return False
        else:
            stock.append(x)
            return True 
n = input()
count = 0
stock = [2]
for i in xrange(n):
    if prime2(input()): count += 1
print count