def checker(x):
    for i in range(2,x//2+1):
        if x % i == 0:
            return False
    return True

cnt = 0
q = int(input())
for _ in range(q):
    v=int(input())
    if checker(v):
        cnt += 1
print(cnt)