def prime_number(num):
    flag = 0
    if num == 2:
        flag =  1
    elif num%2 != 0:
        for j in range(3, num, 2):
            if num%j == 0:
                flag = 0
                break
        flag = 1
    else:
        flag = 0
    return flag

n = int(raw_input())
num = [0 for i in range(n)]
for i in range(n):
    num[i] = int(raw_input())

count = 0
for i in range(n):
    if prime_number(num[i]) == 1:
        count += 1

print count