import sys
import math

lines = sys.stdin.readlines()

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

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



print c