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