import math

def is_prime(num):
    if num == 2:
        return True
    elif num < 2 or num % 2 == 0:
        return False
    else:
        i = 3
        while i < math.sqrt(num):
            if num % i == 0:
                return False
            i += 2
    return True

n = int(input())
prime_numbers = []

for i in range(n):
    num = int(input())
    if is_prime(num):
        prime_numbers.append(num)

print(len(prime_numbers))
