import math

def prime(num):
  for i in range(math.sqrt(num)+1):
    if num%i==0:
      return False
  else:
    return True

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