import sys

count = 0

inarr = 10001 * [False]

for line in sys.stdin:
    n = int(line)
    inarr[n] = True

if inarr[2]:
    count += 1


for n in range(3, 10001):
    if not inarr[n]:
        continue

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

