n = int(input())
count = 0
for _ in range(n):
    num = int(input())
    judge = True
    for p in range(2, int(num**0.5)+1):
        if num % p == 0:
            judge = False
            break
    if judge:
        count += 1
print(count)
