import math
def judge_prime(n):
    for i in range(2,int(math.sqrt(n))+1):
        if n%i==0:
            return False
    return True

n=int(input())
cnt=0
for i in range(n):
    x=int(input())
    if judge_prime(x):
        cnt+=1
print(cnt)
