n = int(input())
cnt = 0
for i in range(n):
    x = int(input())
    j = 2
    flag = 0
    while j <= x ** 1/2:
        if x % j == 0:
            flag = 1
            break
        j += 1
    if flag == 0:
        cnt += 1
print(cnt)
