#16D8101023J 久保田凌弥 kubotarouxxx python3

a=int(input())
A=[0]*a
x=0
for i in range(a):
 A[i]=int(input())
 for j in range(1,A[i]):
  if A[i]==2:
    x+=1
    continue
  if j==1:
   continue
  elif (A[i]%j)==0:
   break
  elif j==(A[i]-1):
   x+=1
   
print(x)
