def IsPrime(n):
    for i in range(2,min(9997,n)):
        if n%i==0:
            return False
    return True


n=int(input())
da=[int(input()) for i in range(n)]
co=0
for i in da:
    if IsPrime(i):
        co+=1
print(co)
