prime_numbers = [2]
def is_prime(n):
  if n in prime_numbers: return True
  if n > prime_numbers[-1]:
    for i in range(prime_numbers[-1] + 1, n):
      is_prime(i)

  for i in prime_numbers:
    if i ** 2 > n: break
    if n % i == 0: return False
  prime_numbers.append(n)
  return True

N = int(input())
count = 0
for i in range(N):
  x = int(input())
  if is_prime(x): count += 1
print(count)