def is_prime(x):

    if x == 2 or x ==3 : return True

    for i in range(2, x//2):
        if x % i == 0:
            return False

    return True


n = int(input())
res = 0

for _ in range(n):
    x = int(input())
    if is_prime(x): res += 1

print(res)