def is_prime(num):
    for n in range(2, int(num**0.5)+1):
        if num % n == 0:
            return False
    return True

n = int(input())
ans = 0
for _ in range(n):
    if is_prime(int(input())):
        ans += 1

print(ans)
