N = int(input())
ns = [int(input()) for _ in range(N)]

primes = set()
def is_prime(n):
  if n in primes:
    return True

  for m in range(2, n):
    if is_prime(m) and n % m == 0:
      return False
  primes.add(n)
  return True

print(len([n for n in ns if is_prime(n)]))