prime = [0] * 10001;prime[0] = 1;prime[1] = 1;Count=0
for i in range(int(10001**.5)):
 if prime[i]:continue
 for j in range(i*i,10001,i):prime[j]=1

for _ in range(int(input())):
 if not(prime[int(input())]):Count+=1
print(Count)