N = int(input())
A = [int(input()) for _ in range(N)]

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

ans = 0
for i in A:
    if is_prime(i):
        ans += 1
print(ans)
