import sys

lines = sys.stdin.readlines()

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

c = 0
for i,v in enumerate(lst):
    if len([j for j in range(1,v+1) if v%float(j) == 0]) == 2:
        c += 1
    else:
        pass


print c