import sys

lines = sys.stdin.readlines()

n = lines[0]
lst = map(lambda x:int(x), lines[1:])

c = 0
for v in lst:
    c2 = 0
    for j in range(2,v):
        if v%float(j) == 0:
            break        
        c += 1



print c