import sys

lines = sys.stdin.readlines()

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

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



print c