import math

def isPrime(n):
  x = int(math.sqrt(n))
  for i in range(2, x+1):
    if n % i == 0:
      return False
      break
  #print(n)
  return True
  

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