import sys
import math


prime_numbers = [2, 3, 5, 7]

def prime_numbers_under(num):
  global prime_numbers

  if max(prime_numbers) > num:
    return list(filter(lambda x: x <= num, prime_numbers))

  primes = prime_numbers_under(num - 1)

  for i in primes:
    if num % i == 0:
      break
  else:
    primes.append(num)

  prime_numbers = primes
  return prime_numbers

def main():
  amount = 0

  length = int(input())
  for _ in range(0, length):
    i = int(input())
    check_max = math.floor(math.sqrt(i))
    for j in prime_numbers_under(check_max):
      if i % j == 0:
        break
    else:
      amount += 1

  print(amount)
  return 0


if __name__ == '__main__':
  main()