import math
n = int(input())
ans = 0

def is_prime(a):
    if a < 2: return False
    for i in range(2, int(math.sqrt(a)) + 1):
        if a % i == 0: return False
    return True

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

print(ans)
