def is_prime(n):
    if n == 1: return False
    i = 2
    while i**2 <= n:
        if n % i == 0: return False
        i += 1
    return True


n = int(input())
ans = 0

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

print(ans)

