import sys

def is_prime(x,y):
    while(y < x):
        if(x % y == 0):
            return 0
        y += 2
    return 1

a = ""
l = []
count = 0
for input in sys.stdin:
    a += input
l = sorted(set(a.split()))
for input in l:
    if(int(input) > 2 and int(input) % 2 != 0 and is_prime(int(input),3)):
        count += 1
    elif(int(input) == 2):
        count += 1
print count
