n = int(input())
given_list = []
for i in range(n):
    num = int(input())
    given_list.append(num)

given_list.sort()


def prime_list(maximum_num):
    known = []
    num = 2
    while num < maximum_num:
        if num == 2: known.append(num)
        for i in known:
            if num % i == 0:
                break
        else:
            known.append(num)


        num += 1
    return known

length = len(given_list)
list_of_primes = prime_list(given_list[length-1])
count = 0
for num in given_list:
    if num in list_of_primes:
        count += 1

print(count)