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

given_list.sort(reverse = True)
known = []
def prime_list(n):
    num = 2
    while num < n+1:
        if num == 2: known.append(2)
        for i in known:
            if num % i == 0:
                break
        else:
            known.append(num)
        num += 1
    return known

def count_prime(given_list):
    count = 0
    for num in given_list:
        if num in known:
            count += 1
        else: pass

    return count

known = prime_list(given_list[0])
result = count_prime(given_list)
print(result)