import fractions

def prime_generator(upper):
    primes = [2, 3]
    yield 2
    yield 3

    for i in range(5, upper+1, 2):
        is_prime = True
        for p in primes:
            if p ** 2 > i:
                break
            if i % p == 0:
                is_prime = False
                break
        if is_prime:
            primes.append(i)
            yield i

if __name__ == '__main__':
    n = int(input())
    inputs = [int(input()) for _ in range(n)]
    inputs.sort()
    inputs.append(10**8+1)
    index = 0
    cnt = 0

    for p in prime_generator(inputs[n-1]):
        if index >= n:
            break

        while p > inputs[index] and index < n:
            index += 1

        if p == inputs[index]:
            while p == inputs[index] and index < n:
                index += 1
                cnt += 1
            continue

        if p < inputs[index]:
            continue

    print(cnt)