n = int(input())
mlist = []
for i in range(n):
    m = int(input())
    mlist.append(m)
mlist.sort()
plist = [2]
for i in range(3,mlist[-1]+1):
    count = 0
    for k in plist:
        if (i%k != 0):
            count += 1
        else:
            break
    if (count == len(plist)):
        plist.append(i)
count = 0
for i in mlist:
    if(i in plist):
        count += 1
print(count)  

