n = int(input())
count = 0

for i in range(n):
    data = int(input())
    if data == 2:
        count += 1
    for j in range(2,data):
        if data % j == 0:
            break
        elif j == data - 1:
            count += 1

print(count)