n = int(input())
cnt = 0
for i in range(n):
    p = int(input())
    if p == 2:
        continue
    for j in range(2, int(p**(1/2))+1):
        if p % j == 0:
            cnt +=1
            break
print(n - cnt)
