import math

def fun(n):
    if n%2==0 and n!=2:return False
    for i in range(3,round(math.sqrt(n))+1,2):
        if n%i==0:return False
    else: return True

n=int(input())
count=0
for i in range(n):
    if fun(int(input())):
        count+=1
print(count)
