import sys

count = 0

inarr = set()

for line in sys.stdin:
    inarr.add(int(line))

for n in inarr:
    if n == 2:
        count += 1
        continue

    jdg = True
    for i in range(2, n):
        if n % i == 0:
            jdg = False
            break
    if jdg:
        count += 1

print(count)

