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 = (a.split())
b = int(l[0])
l = sorted(set(l[1:]))
for i in l:
    if(int(i) == 2):
        count += 1
    elif(int(i) > 2 and int(i) % 2 != 0 and is_prime(int(i),3) == 1):
        count += 1
print count
