from math import sqrt
n = int(input())
count = 0
for i in range(n):
    x = int(input())
    judge = True
    for j in range(2, int(sqrt(x))+1):
        if x % j == 0:
            judge = False
            break
    if(judge): count+=1
print(count)
