n = int(input())

A = [0] * n
for i in range(n):
    A[i] = int(input())

def is_prime(n):
    if n < 2:
        return False
    if n == 2:
        return True
    if n % 2 == 0:
        return False
    for i in range(3, n, 2):
        if n % i == 0:
            return False
    return True

print(len([x for x in A if is_prime(x)]))